client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetEntriesRequest

type GetEntriesRequest struct {
	Start   uint64
	End     uint64
	Limit   int64
	Machine string
	Command string
}

GetEntriesRequest contains the request params to query for history entries

type HistoryClient

type HistoryClient struct {
	// contains filtered or unexported fields
}

HistoryClient provides the client SDK to talk to the HistoryServer

func NewHistoryClient

func NewHistoryClient(remoteURL string, userToken string, timeout int) (*HistoryClient, error)

NewHistoryClient initializes a new HistoryClient

func (*HistoryClient) GetEntries

func (c *HistoryClient) GetEntries(req GetEntriesRequest) ([]history.Entry, error)

GetEntries fetches history events from the server

func (*HistoryClient) Login

func (c *HistoryClient) Login(req LoginRequest) (tokenStr string, err error)

Login logs into the service and retrieves the token for subsequent use

func (*HistoryClient) PutEntries

func (c *HistoryClient) PutEntries(req PutEntriesRequest) (updated int64, err error)

PutEntries sends the history events to the server

func (*HistoryClient) Register

func (c *HistoryClient) Register(req RegisterRequest) error

Register creates an account on the remote service

type LoginRequest

type LoginRequest struct {
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

LoginRequest contains user information to register

type PutEntriesRequest

type PutEntriesRequest struct {
	Entries []history.Entry `json:"entries,omitempty"`
}

PutEntriesRequest contains the parameters to send history entries

type RegisterRequest

type RegisterRequest struct {
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

RegisterRequest contains user information to register

Jump to

Keyboard shortcuts

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