Documentation ¶
Index ¶
- func NewWhitelistMiddleware(permittedAddrs []types.Address, jwtSecret []byte, nextHandler http.Handler) *whitelistMiddleware
- func StartHTTPRPC(svc interface{}, config *HTTPConfig, jwtSecret []byte) (*http.Server, error)
- type AddPeerArgs
- type AddPeerResponse
- type AddStaticRelayArgs
- type AddStaticRelayResponse
- type HTTPClient
- func (c *HTTPClient) AddPeer(args AddPeerArgs) error
- func (c *HTTPClient) Authorize(signingKeypair *crypto.SigKeypair) error
- func (c *HTTPClient) Close() error
- func (c *HTTPClient) Identities() ([]Identity, error)
- func (c *HTTPClient) NewIdentity(args NewIdentityArgs) error
- func (c *HTTPClient) SendTx(args SendTxArgs) error
- func (c *HTTPClient) StateURIsWithData() ([]string, error)
- func (c *HTTPClient) StoreBlob(args StoreBlobArgs) (StoreBlobResponse, error)
- func (c *HTTPClient) Subscribe(args SubscribeArgs) error
- type HTTPConfig
- type HTTPServer
- func (s *HTTPServer) AddPeer(r *http.Request, args *AddPeerArgs, resp *AddPeerResponse) error
- func (s *HTTPServer) AddStaticRelay(r *http.Request, args *AddStaticRelayArgs, resp *AddStaticRelayResponse) error
- func (s *HTTPServer) Identities(r *http.Request, args *IdentitiesArgs, resp *IdentitiesResponse) error
- func (s *HTTPServer) NewIdentity(r *http.Request, args *NewIdentityArgs, resp *NewIdentityResponse) error
- func (s *HTTPServer) Peers(r *http.Request, args *PeersArgs, resp *PeersResponse) error
- func (s *HTTPServer) RemoveStaticRelay(r *http.Request, args *RemoveStaticRelayArgs, resp *RemoveStaticRelayResponse) error
- func (s *HTTPServer) SendTx(r *http.Request, args *SendTxArgs, resp *SendTxResponse) error
- func (s *HTTPServer) StateURIsWithData(r *http.Request, args *StateURIsWithDataArgs, resp *StateURIsWithDataResponse) error
- func (s *HTTPServer) StaticRelays(r *http.Request, args *StaticRelaysArgs, resp *StaticRelaysResponse) error
- func (s *HTTPServer) StoreBlob(r *http.Request, args *StoreBlobArgs, resp *StoreBlobResponse) error
- func (s *HTTPServer) Subscribe(r *http.Request, args *SubscribeArgs, resp *SubscribeResponse) (err error)
- func (s *HTTPServer) Ucan(r *http.Request, args *UcanArgs, resp *UcanResponse) error
- type HTTPWhitelistConfig
- type IdentitiesArgs
- type IdentitiesResponse
- type Identity
- type NewIdentityArgs
- type NewIdentityResponse
- type Peer
- type PeerIdentity
- type PeersArgs
- type PeersResponse
- type RemoveStaticRelayArgs
- type RemoveStaticRelayResponse
- type SendTxArgs
- type SendTxResponse
- type StateURIsWithDataArgs
- type StateURIsWithDataResponse
- type StaticRelaysArgs
- type StaticRelaysResponse
- type StoreBlobArgs
- type StoreBlobResponse
- type SubscribeArgs
- type SubscribeResponse
- type UcanArgs
- type UcanResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWhitelistMiddleware ¶
func StartHTTPRPC ¶
func StartHTTPRPC(svc interface{}, config *HTTPConfig, jwtSecret []byte) (*http.Server, error)
Types ¶
type AddPeerArgs ¶
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 ¶
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 IdentitiesArgs ¶
type IdentitiesArgs struct{}
type IdentitiesResponse ¶
type IdentitiesResponse struct {
Identities []Identity
}
type NewIdentityArgs ¶
type NewIdentityArgs struct {
Public bool
}
type NewIdentityResponse ¶
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 PeersResponse ¶
type PeersResponse struct {
Peers []Peer
}
type RemoveStaticRelayArgs ¶
type RemoveStaticRelayArgs struct {
DialAddr string
}
type RemoveStaticRelayResponse ¶
type RemoveStaticRelayResponse struct{}
type SendTxArgs ¶
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 SubscribeArgs ¶
type SubscribeResponse ¶
type SubscribeResponse struct{}
type UcanResponse ¶
type UcanResponse struct {
JWT string
}
Click to show internal directories.
Click to hide internal directories.