core

package
v0.0.0-...-86ca01b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: MIT Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Server     string
	Token      string
	Renew      string
	Lifetime   int64
	Username   string
	ServerSkew int64
}

type Connection

type Connection struct {
	PrintOptions *PrintOptions
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(po *PrintOptions, server string, token string, login string, password string, ignoressc bool, renew string, lifetime int64, serverskew int64) *Connection

func NewConnectionFromCLIContext

func NewConnectionFromCLIContext(po *PrintOptions, c *cli.Context) *Connection

func (*Connection) Auth

func (c *Connection) Auth(askpassword func() string, doRenew bool) error

func (*Connection) Get

func (c *Connection) Get(urlEnd string) ([]byte, int, error)

func (*Connection) GetLifetime

func (c *Connection) GetLifetime() int64

func (*Connection) GetRenew

func (c *Connection) GetRenew() string

func (*Connection) GetServer

func (c *Connection) GetServer() string

func (*Connection) GetServerSkew

func (c *Connection) GetServerSkew() int64

func (*Connection) GetToken

func (c *Connection) GetToken() string

func (*Connection) GetUsername

func (c *Connection) GetUsername() string

func (*Connection) MakeUrl

func (c *Connection) MakeUrl(urlEnd string) string

func (*Connection) Post

func (c *Connection) Post(urlEnd string, json []byte) ([]byte, int, error)

type HeartbeatMessage

type HeartbeatMessage struct {
	Status string `json:"status"`
}

type JSONOut

type JSONOut struct {
	Error string      `json:"error"`
	Data  interface{} `json:"data"`
}

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type PrintOptions

type PrintOptions struct {
	Json bool
	// contains filtered or unexported fields
}

func NewPrintOptions

func NewPrintOptions(json bool, verbose bool) PrintOptions

func NewPrintOptionsFromCLIContext

func NewPrintOptionsFromCLIContext(c *cli.Context) PrintOptions

func (*PrintOptions) MarshalPrintJSON

func (p *PrintOptions) MarshalPrintJSON(m interface{})

temporary, please use error pass through

func (*PrintOptions) MarshalPrintJSONError

func (p *PrintOptions) MarshalPrintJSONError(m interface{}, err error) error

func (*PrintOptions) Print

func (p *PrintOptions) Print(txt string)

func (*PrintOptions) Printf

func (p *PrintOptions) Printf(txt string, v ...interface{})

func (*PrintOptions) Println

func (p *PrintOptions) Println(a ...interface{})

func (*PrintOptions) Verbose

func (p *PrintOptions) Verbose(txt string)

func (*PrintOptions) Verbosef

func (p *PrintOptions) Verbosef(txt string, v ...interface{})

type ReturnStatus

type ReturnStatus struct {
	Status string `json:"status"`
	Id     string `json:"id,omitempty"`
	SubId  string `json:"subid,omitempty"`
}

very generic return can be used for error handling

type SendID

type SendID struct {
	Id     string `json:"id,omitempty"`
	Action string `json:"action,omitempty"`
	Data   string `json:"data,omitempty"`
}

very generic send option

type Token

type Token struct {
	Token      string `json:"token"`
	Renew      string `json:"renew"`
	Lifetime   int64  `json:"lifetime"`
	Status     string `json:"status"`
	ServerTime int64  `json:"now"`
}

Jump to

Keyboard shortcuts

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