Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ReportExpiration = 60 * time.Second
Functions ¶
Types ¶
type BasicClient ¶
type Client ¶
type Client struct { HTTPClient SessionEndpoint string ReportEndpoint string }
func (*Client) NewSession ¶
func (c *Client) NewSession(ctx context.Context, in *SessionRequest) (*SessionReply, error)
func (*Client) SendReport ¶
func (c *Client) SendReport(ctx context.Context, in *ReportRequest) (*ReportReply, error)
type HTTPClient ¶
type Options ¶
type Options struct { // ClusterID identifies the cluster ClusterID string // ServerID identifies the instance ServerID string // URL is the base path of the remote service URL string // Version of the application reporting Version string // Minter is the default Minter injected into the Reporter Minter Minter // ExtraPayload is the extra information to send with the first report ExtraPayload []byte // HashBits are the number of bits of collision HashBits uint // SaltChars are the number of bytes of salt chars SaltChars uint //SessionEndpoint is the path of the session endpoint SessionEndpoint string // ReportEndpoint is the path of the report endpoint ReportEndpoint string // Timeout is the max duration of every request Timeout time.Duration // ReportLapse is the waiting time between reports ReportLapse time.Duration // UserAgent is the value of the user-agent header to send with the requests UserAgent string // Client is the http client to use. If nil, a new http client will be created Client *http.Client }
type ReportReply ¶
type ReportRequest ¶
type SessionReply ¶
type SessionReply struct {
Token string `json:"token"`
}
type SessionRequest ¶
type UsageClient ¶
type UsageClient interface { NewSession(context.Context, *SessionRequest) (*SessionReply, error) SendReport(context.Context, *ReportRequest) (*ReportReply, error) }
Click to show internal directories.
Click to hide internal directories.