rpc

package
v0.0.0-...-2c4dd60 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWhitelistMiddleware

func NewWhitelistMiddleware(permittedAddrs []types.Address, jwtSecret []byte, nextHandler http.Handler) *whitelistMiddleware

func StartHTTPRPC

func StartHTTPRPC(svc interface{}, config *HTTPConfig, jwtSecret []byte) (*http.Server, error)

Types

type AddPeerArgs

type AddPeerArgs struct {
	TransportName string
	DialAddr      string
}

type AddPeerResponse

type AddPeerResponse struct{}

type AddStaticRelayArgs

type AddStaticRelayArgs struct {
	DialAddr string
}

type AddStaticRelayResponse

type AddStaticRelayResponse struct{}

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(dialAddr string) *HTTPClient

func (*HTTPClient) AddPeer

func (c *HTTPClient) AddPeer(args AddPeerArgs) error

func (*HTTPClient) Authorize

func (c *HTTPClient) Authorize(signingKeypair *crypto.SigKeypair) error

func (*HTTPClient) Close

func (c *HTTPClient) Close() error

func (*HTTPClient) Identities

func (c *HTTPClient) Identities() ([]Identity, error)

func (*HTTPClient) NewIdentity

func (c *HTTPClient) NewIdentity(args NewIdentityArgs) error

func (*HTTPClient) SendTx

func (c *HTTPClient) SendTx(args SendTxArgs) error

func (*HTTPClient) StateURIsWithData

func (c *HTTPClient) StateURIsWithData() ([]string, error)

func (*HTTPClient) StoreBlob

func (c *HTTPClient) StoreBlob(args StoreBlobArgs) (StoreBlobResponse, error)

func (*HTTPClient) Subscribe

func (c *HTTPClient) Subscribe(args SubscribeArgs) error

type HTTPConfig

type HTTPConfig struct {
	Enabled     bool                                      `json:"enabled"    yaml:"Enabled"`
	ListenHost  string                                    `json:"listenHost" yaml:"ListenHost"`
	TLSCertFile string                                    `json:"tlsCertFile" yaml:"TLSCertFile"`
	TLSKeyFile  string                                    `json:"tlsKeyFile" yaml:"TLSKeyFile"`
	Whitelist   HTTPWhitelistConfig                       `json:"whitelist"  yaml:"Whitelist"`
	Server      func(innerServer *HTTPServer) interface{} `json:"-"          yaml:"-"`
}

type HTTPServer

type HTTPServer struct {
	log.Logger
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(
	jwtSecret []byte,
	authProto protoauth.AuthProtocol,
	blobProto protoblob.BlobProtocol,
	treeProto prototree.TreeProtocol,
	peerStore swarm.PeerStore,
	keyStore identity.KeyStore,
	blobStore blob.Store,
	controllerHub tree.ControllerHub,
	libp2pTransport libp2p.Transport,
) *HTTPServer

func (*HTTPServer) AddPeer

func (s *HTTPServer) AddPeer(r *http.Request, args *AddPeerArgs, resp *AddPeerResponse) error

func (*HTTPServer) AddStaticRelay

func (s *HTTPServer) AddStaticRelay(r *http.Request, args *AddStaticRelayArgs, resp *AddStaticRelayResponse) error

func (*HTTPServer) Identities

func (s *HTTPServer) Identities(r *http.Request, args *IdentitiesArgs, resp *IdentitiesResponse) error

func (*HTTPServer) NewIdentity

func (s *HTTPServer) NewIdentity(r *http.Request, args *NewIdentityArgs, resp *NewIdentityResponse) error

func (*HTTPServer) Peers

func (s *HTTPServer) Peers(r *http.Request, args *PeersArgs, resp *PeersResponse) error

func (*HTTPServer) RemoveStaticRelay

func (s *HTTPServer) RemoveStaticRelay(r *http.Request, args *RemoveStaticRelayArgs, resp *RemoveStaticRelayResponse) error

func (*HTTPServer) SendTx

func (s *HTTPServer) SendTx(r *http.Request, args *SendTxArgs, resp *SendTxResponse) error

func (*HTTPServer) StateURIsWithData

func (s *HTTPServer) StateURIsWithData(r *http.Request, args *StateURIsWithDataArgs, resp *StateURIsWithDataResponse) error

func (*HTTPServer) StaticRelays

func (s *HTTPServer) StaticRelays(r *http.Request, args *StaticRelaysArgs, resp *StaticRelaysResponse) error

func (*HTTPServer) StoreBlob

func (s *HTTPServer) StoreBlob(r *http.Request, args *StoreBlobArgs, resp *StoreBlobResponse) error

func (*HTTPServer) Subscribe

func (s *HTTPServer) Subscribe(r *http.Request, args *SubscribeArgs, resp *SubscribeResponse) (err error)

func (*HTTPServer) Ucan

func (s *HTTPServer) Ucan(r *http.Request, args *UcanArgs, resp *UcanResponse) error

type HTTPWhitelistConfig

type HTTPWhitelistConfig struct {
	Enabled        bool            `json:"enabled"        yaml:"Enabled"`
	PermittedAddrs []types.Address `json:"permittedAddrs" yaml:"PermittedAddrs"`
}

type IdentitiesArgs

type IdentitiesArgs struct{}

type IdentitiesResponse

type IdentitiesResponse struct {
	Identities []Identity
}

type Identity

type Identity struct {
	Address types.Address
	Public  bool
}

type NewIdentityArgs

type NewIdentityArgs struct {
	Public bool
}

type NewIdentityResponse

type NewIdentityResponse struct {
	Address types.Address
}

type Peer

type Peer struct {
	Identities  []PeerIdentity
	Transport   string
	DialAddr    string
	StateURIs   []string
	LastContact uint64
}

type PeerIdentity

type PeerIdentity struct {
	Address          types.Address
	SigningPublicKey *crypto.SigningPublicKey
	AsymEncPubkey    *crypto.AsymEncPubkey
}

type PeersArgs

type PeersArgs struct {
	StateURI string
}

type PeersResponse

type PeersResponse struct {
	Peers []Peer
}

type RemoveStaticRelayArgs

type RemoveStaticRelayArgs struct {
	DialAddr string
}

type RemoveStaticRelayResponse

type RemoveStaticRelayResponse struct{}

type SendTxArgs

type SendTxArgs struct {
	Tx tree.Tx
}

type SendTxResponse

type SendTxResponse struct{}

type StateURIsWithDataArgs

type StateURIsWithDataArgs struct{}

type StateURIsWithDataResponse

type StateURIsWithDataResponse struct {
	StateURIs []string
}

type StaticRelaysArgs

type StaticRelaysArgs struct{}

type StaticRelaysResponse

type StaticRelaysResponse struct {
	StaticRelays []string
}

type StoreBlobArgs

type StoreBlobArgs struct {
	Blob []byte
}

type StoreBlobResponse

type StoreBlobResponse struct {
	SHA1 types.Hash
	SHA3 types.Hash
}

type SubscribeArgs

type SubscribeArgs struct {
	StateURI string
	Txs      bool
	States   bool
	Keypath  string
}

type SubscribeResponse

type SubscribeResponse struct{}

type UcanArgs

type UcanArgs struct{}

type UcanResponse

type UcanResponse struct {
	JWT string
}

Jump to

Keyboard shortcuts

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