nip46

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: CC0-1.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	ID     string   `json:"id"`
	Method string   `json:"method"`
	Params []string `json:"params"`
}

type Response

type Response struct {
	ID     string `json:"id"`
	Error  string `json:"error,omitempty"`
	Result string `json:"result,omitempty"`
}

type Session

type Session struct {
	SharedKey []byte
}

func (Session) MakeResponse

func (s Session) MakeResponse(
	id string,
	requester string,
	result string,
	e error,
) (resp Response, ev event.T, err error)

func (Session) ParseRequest

func (s Session) ParseRequest(evt *event.T) (Request, error)

type Signer

type Signer struct {
	RelaysToAdvertise map[string]relayReadWrite
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner(secretKey string) Signer

func (*Signer) AddRelayToAdvertise

func (p *Signer) AddRelayToAdvertise(url string, read bool, write bool)

func (*Signer) GetSession

func (p *Signer) GetSession(clientPubkey string) (Session, error)

func (*Signer) HandleRequest

func (p *Signer) HandleRequest(evt *event.T) (req Request, resp Response, eventResponse event.T, harmless bool, e error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL