Help us shape the future of Go! Take the 2026 Go Developer Survey

utclient

package
v1.3.101 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1

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

type MockAPIClient struct {
	mock.Mock
}

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

func (_m *MockAPIClient) FetchUptimes(_a0 context.Context, _a1 string) ([]byte, error)

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

Jump to

Keyboard shortcuts

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