client

package
v0.0.0-...-4aac04f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_NEW        clientState = iota
	STATE_AUTHED     clientState = iota
	STATE_CLOSED     clientState = iota
	STATE_LOGGED_OFF clientState = iota
)
View Source
const (
	//login field names
	USER_FIELD string = "User"
	PASS_FIELD string = "Pass"

	//path to login url
	LOGIN_URL      = `/api/login`
	TEST_URL       = `/api/test`
	TEST_AUTH_URL  = `/api/testauth`
	PUSH_SHARD_URL = `/api/shard/%v/%v/%v/%v`
)

Variables

View Source
var (
	ErrInvalidTestStatus error = errors.New("Invalid status on webserver test")
	ErrAccountLocked     error = errors.New(`Account is Locked`)
	ErrLoginFail         error = errors.New(`Username and Password are incorrect`)
	ErrNotSynced         error = errors.New(`Client has not been synced`)
	ErrNoLogin           error = errors.New("Not logged in")
)
View Source
var (
	ErrNotAuthed = errors.New("Not Authed")
)

Functions

This section is empty.

Types

type ActiveSession

type ActiveSession struct {
	JWT                string
	LastNotificationID uint64
}

type Client

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

func NewClient

func NewClient(server string, enforceCertificate, useHttps bool) (*Client, error)

NewClient creates a new client targeted at server. enforceCertificate allows for self-signed certs

func (*Client) GetWellShardsInTimeframe

func (c *Client) GetWellShardsInTimeframe(guid, well string, tf util.Timeframe) ([]string, error)

func (*Client) GetWellTimeframe

func (c *Client) GetWellTimeframe(guid, well string) (util.Timeframe, error)

func (*Client) ListIndexerWells

func (c *Client) ListIndexerWells(guid string) ([]string, error)

func (*Client) ListIndexers

func (c *Client) ListIndexers() ([]string, error)

func (*Client) Login

func (c *Client) Login(user, pass string) error

Login logs into the URL and grabs the jwt

func (*Client) PullShard

func (c *Client) PullShard(sid ShardID, spath string, cancel context.Context) error

func (*Client) PullTags

func (c *Client) PullTags(guid string) (tset []tags.TagPair, err error)

func (*Client) PushShard

func (c *Client) PushShard(sid ShardID, spath string, tps []tags.TagPair, tags []string, ctx context.Context) error

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(val string)

func (*Client) SyncTags

func (c *Client) SyncTags(guid string, idxTags []tags.TagPair) (tset []tags.TagPair, err error)

func (*Client) Test

func (c *Client) Test() error

Test checks if the specified webserver is functioning

func (*Client) TestLogin

func (c *Client) TestLogin() error

TestLogin checks if we're logged in to the webserver

type ClientSource

type ClientSource interface {
	io.Reader
	Cancel()
}

type ShardID

type ShardID struct {
	Indexer uuid.UUID //indexer GUID
	Well    string    //well name
	Shard   string    //shard ID
}

func (ShardID) PushShardUrl

func (sid ShardID) PushShardUrl(custID uint64) string

Jump to

Keyboard shortcuts

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