Documentation ¶
Index ¶
- Variables
- func CheckNameAvailability(ctx context.Context, name, domain string) bool
- func IsValidBunkerURL(input string) bool
- type BunkerClient
- func ConnectBunker(ctx context.Context, clientSecretKey string, bunkerURLOrNIP05 string, ...) (*BunkerClient, error)
- func CreateAccount(ctx context.Context, clientSecretKey string, name string, domain string, ...) (*BunkerClient, error)
- func NewBunker(ctx context.Context, clientSecretKey string, targetPublicKey string, ...) *BunkerClient
- func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
- func (bunker *BunkerClient) Ping(ctx context.Context) error
- func (bunker *BunkerClient) RPC(ctx context.Context, method string, params []string) (string, error)
- func (bunker *BunkerClient) SignEvent(ctx context.Context, evt *nostr.Event) error
- type CreateAccountOptions
- type DynamicSigner
- type RelayReadWrite
- type Request
- type Response
- type Session
- type Signer
- type StaticKeySigner
Constants ¶
This section is empty.
Variables ¶
View Source
var BUNKER_REGEX = regexp.MustCompile(`^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$`)
Functions ¶
func CheckNameAvailability ¶
func IsValidBunkerURL ¶
Types ¶
type BunkerClient ¶
type BunkerClient struct {
// contains filtered or unexported fields
}
func ConnectBunker ¶
func ConnectBunker( ctx context.Context, clientSecretKey string, bunkerURLOrNIP05 string, pool *nostr.SimplePool, onAuth func(string), ) (*BunkerClient, error)
ConnectBunker establishes an RPC connection to a NIP-46 signer using the relays and secret provided in the bunkerURL. pool can be passed to reuse an existing pool, otherwise a new pool will be created.
func CreateAccount ¶
func CreateAccount( ctx context.Context, clientSecretKey string, name string, domain string, pool *nostr.SimplePool, extraOpts *CreateAccountOptions, onAuth func(string), ) (*BunkerClient, error)
func (*BunkerClient) GetPublicKey ¶
func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
type CreateAccountOptions ¶
type CreateAccountOptions struct {
Email string
}
type DynamicSigner ¶
type DynamicSigner struct { sync.Mutex RelaysToAdvertise map[string]RelayReadWrite // contains filtered or unexported fields }
func NewDynamicSigner ¶
func (*DynamicSigner) GetSession ¶
func (p *DynamicSigner) GetSession(clientPubkey string) (Session, bool)
func (*DynamicSigner) HandleRequest ¶
func (p *DynamicSigner) HandleRequest(event *nostr.Event) ( req Request, resp Response, eventResponse nostr.Event, err error, )
type RelayReadWrite ¶
type StaticKeySigner ¶
type StaticKeySigner struct { sync.Mutex RelaysToAdvertise map[string]RelayReadWrite AuthorizeRequest func(harmless bool, from string) bool // contains filtered or unexported fields }
func NewStaticKeySigner ¶
func NewStaticKeySigner(secretKey string) StaticKeySigner
func (*StaticKeySigner) GetSession ¶
func (p *StaticKeySigner) GetSession(clientPubkey string) (Session, bool)
func (*StaticKeySigner) HandleRequest ¶
func (p *StaticKeySigner) HandleRequest(event *nostr.Event) ( req Request, resp Response, eventResponse nostr.Event, err error, )
Click to show internal directories.
Click to hide internal directories.