Documentation
¶
Overview ¶
Package utclient pkg/utclient/client.go c2-net-discovery
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
UpdateVisorUptime(context.Context, string) error
FetchUptimes(context.Context, string) ([]byte, error)
}
APIClient implements uptime tracker API client.
func NewHTTP ¶
func NewHTTP(addr string, pk cipher.PubKey, sk cipher.SecKey, httpC *http.Client, clientPublicIP string, mLogger *logging.MasterLogger) (APIClient, error)
NewHTTP creates a new client setting a public key to the client to be used for auth. When keys are set, the client will sign request before submitting. The signature information is transmitted in the header using: * SW-Public: The specified public key * SW-Nonce: The nonce for that public key * SW-Sig: The signature of the payload + the nonce
type MockAPIClient ¶
MockAPIClient is an autogenerated mock type for the APIClient type
func NewMockAPIClient ¶
func NewMockAPIClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockAPIClient
NewMockAPIClient creates a new instance of MockAPIClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockAPIClient) FetchUptimes ¶
FetchUptimes provides a mock function with given fields: _a0, _a1
func (*MockAPIClient) UpdateVisorUptime ¶
func (_m *MockAPIClient) UpdateVisorUptime(_a0 context.Context, _a1 string) error
UpdateVisorUptime provides a mock function with given fields: _a0, _a1