Documentation ¶
Index ¶
- type Client
- func (c *Client) AuthenticationService() *authentication.Service
- func (c *Client) ChatService() *chat.Service
- func (c *Client) Close() error
- func (c *Client) DocsService() *documents.Service
- func (c *Client) FactService() *fact.Service
- func (c *Client) IdentityService() *identity.Service
- func (c *Client) MessagingService() *messaging.Service
- func (c *Client) Rest() RestTransport
- func (c *Client) SelfAppID() string
- func (c *Client) Start() error
- func (c *Client) VoiceService() *voice.Service
- type Config
- type Connectors
- type MessagingClient
- type PKIClient
- type RestTransport
- type Storage
- type WebsocketTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles all interactions with self services
func (*Client) AuthenticationService ¶
func (c *Client) AuthenticationService() *authentication.Service
AuthenticationService returns a client for working with authentication
func (*Client) ChatService ¶
ChatService returns a client for interacting with chat
func (*Client) DocsService ¶
DocsService returns a client for interacting with document signatures.
func (*Client) FactService ¶
FactService returns a client for working with facts
func (*Client) IdentityService ¶
IdentityService returns a client for working with identities
func (*Client) MessagingService ¶
MessagingService returns a client for working with messages
func (*Client) Rest ¶
func (c *Client) Rest() RestTransport
Rest provides access to the rest client to interact used by the sdk.
func (*Client) VoiceService ¶
VoiceService returns a client for managing voice call negotiation.
type Config ¶
type Config struct { SelfAppID string SelfAppDeviceSecret string StorageKey string DeviceID string StorageDir string APIURL string MessagingURL string Environment string OnConnect func() OnDisconnect func(err error) OnPing func() ReconnectionAttempts int TCPDeadline time.Duration RequestTimeout time.Duration SyncInterval time.Duration Connectors *Connectors // contains filtered or unexported fields }
Config configuration options for the sdk
type Connectors ¶
type Connectors struct { Rest RestTransport Websocket WebsocketTransport Messaging MessagingClient PKI PKIClient Storage Storage FileInteractor remoteFile }
Connectors stores all connectors for working with different self api's
type MessagingClient ¶
type MessagingClient interface { Start() bool Send(recipients []string, mtype string, plaintext []byte) error SendAsync(recipients []string, mtype string, plaintext []byte, callback func(error)) Request(recipients []string, cid string, mtype string, data []byte, timeout time.Duration) (string, []byte, error) Register(cid string) Wait(cid string, timeout time.Duration) (string, []byte, error) Subscribe(msgType string, sub func(sender string, payload []byte)) Close() error }
MessagingClient defines the interface required for the sdk to perform operations against self's messaging service
type PKIClient ¶
type PKIClient interface { GetHistory(selfID string) ([]json.RawMessage, error) GetDeviceKey(selfID, deviceID string) ([]byte, error) SetDeviceKeys(selfID, deviceID string, pkb []byte) error ListDeviceKeys(selfID, deviceID string) ([]byte, error) }
PKIClient defines the interface required for the sdk to perform retrieving identity and device public keys from self
type RestTransport ¶
type RestTransport interface { Get(path string) ([]byte, error) Post(path string, ctype string, data []byte) ([]byte, error) Put(path string, ctype string, data []byte) ([]byte, error) Delete(path string) ([]byte, error) BuildURL(path string) string }
RestTransport defines the interface required for the sdk to perform operations against self's rest api
type Storage ¶
type Storage interface { AccountCreate(inboxID string, secretKey ed25519.PrivateKey) error AccountOffset(inboxID string) (int64, error) Encrypt(from string, to []string, plaintext []byte) ([]byte, error) Decrypt(from, to string, offset int64, ciphertext []byte) ([]byte, error) Close() error }
Storage the storage interface that is used to handle persistence across
type WebsocketTransport ¶
type WebsocketTransport interface { Send(recipients []string, mtype string, priority int, data []byte) error SendAsync(recipients []string, mtype string, priority int, data []byte, callback func(error)) Receive() ([]byte, string, int64, []byte, error) Connect() error Close() error }
WebsocketTransport defines the interface required for the sdk to perform operations against self's websocket services