Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CRC16("github.com/privatix/dappctrl/client/somc") = 0x42AE ErrUnknownSOMCType errors.Error = 0x42AE<<8 + iota )
Errors returned by workers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Endpoint(data.Base64String) (data.Base64String, error) Offering(data.HexString) (data.Base64String, error) Ping() error }
Client is expected somc clients interface.
type ClientBuilder ¶
type ClientBuilder struct {
// contains filtered or unexported fields
}
ClientBuilder responsible for creating Client's.
func NewClientBuilder ¶
func NewClientBuilder(torSocks uint) *ClientBuilder
NewClientBuilder creates new ClientBuilder.
func (*ClientBuilder) NewClient ¶
func (b *ClientBuilder) NewClient(somcType uint8, somcData data.Base64String) (Client, error)
NewClient returns new client instance based given somc type and data.
type ClientBuilderInterface ¶
type ClientBuilderInterface interface {
NewClient(uint8, data.Base64String) (Client, error)
}
ClientBuilderInterface an abstract layer for builder, introduced mainly for tests.
type TestClient ¶
type TestClient struct { V data.Base64String Err error }
TestClient for tests.
func NewTestClient ¶
func NewTestClient() *TestClient
NewTestClient creates new test client instance.
func (*TestClient) Endpoint ¶
func (c *TestClient) Endpoint(data.Base64String) (data.Base64String, error)
Endpoint return stored V, Err values.
func (*TestClient) Offering ¶
func (c *TestClient) Offering(data.HexString) (data.Base64String, error)
Offering return stored V, Err values.
type TestClientBuilder ¶
type TestClientBuilder struct {
// contains filtered or unexported fields
}
TestClientBuilder for tests.
func NewTestClientBuilder ¶
func NewTestClientBuilder(client Client) *TestClientBuilder
NewTestClientBuilder creates client builder that always returns same client.
func (*TestClientBuilder) NewClient ¶
func (b *TestClientBuilder) NewClient(uint8, data.Base64String) (Client, error)
NewClient returns stored client instance.
Click to show internal directories.
Click to hide internal directories.