cwapi

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCreds

type ApiCreds struct {
	User     string `json:"machine_id" yaml:"machine_id"`
	Password string `json:"password" yaml:"password"`
	Profile  string `json:"profile,omitempty" yaml:"profile,omitempty"`
}

type ApiCtx

type ApiCtx struct {
	/*config*/
	ApiVersion   string   `yaml:"version"`
	PullPath     string   `yaml:"pull_path"`
	PushPath     string   `yaml:"push_path"`
	SigninPath   string   `yaml:"signin_path"`
	RegisterPath string   `yaml:"register_path"`
	ResetPwdPath string   `yaml:"reset_pwd_path"`
	EnrollPath   string   `yaml:"enroll_path"`
	BaseURL      string   `yaml:"url"`
	CfgUser      string   `yaml:"machine_id"`
	CfgPassword  string   `yaml:"password"`
	Creds        ApiCreds `yaml:"-"`
	/*mostly for mocking/faking api*/
	Muted     bool `yaml:"-"`
	DebugDump bool `yaml:"-"`

	Http       *sling.Sling `yaml:"-"`
	PusherTomb tomb.Tomb    `yaml:"-"`
	// contains filtered or unexported fields
}

func (*ApiCtx) AppendSignal

func (ctx *ApiCtx) AppendSignal(sig types.SignalOccurence) error

func (*ApiCtx) Enroll

func (ctx *ApiCtx) Enroll(userID string) error

func (*ApiCtx) Flush

func (ctx *ApiCtx) Flush() error

func (*ApiCtx) Init

func (ctx *ApiCtx) Init(cfg string, profile string) error

func (*ApiCtx) LoadConfig

func (ctx *ApiCtx) LoadConfig(cfg string) error

func (*ApiCtx) PullTop

func (ctx *ApiCtx) PullTop() ([]map[string]string, error)

func (*ApiCtx) RegisterMachine

func (ctx *ApiCtx) RegisterMachine(machineID string, password string) error

func (*ApiCtx) ResetPassword

func (ctx *ApiCtx) ResetPassword(machineID string, password string) error

func (*ApiCtx) Shutdown added in v0.2.0

func (ctx *ApiCtx) Shutdown() error

func (*ApiCtx) Signin

func (ctx *ApiCtx) Signin() error

func (*ApiCtx) WriteConfig

func (ctx *ApiCtx) WriteConfig(cfg string) error

type ApiResp

type ApiResp struct {
	StatusCode int    `json:"statusCode"`
	Error      string `json:"error"`
	Message    string `json:"message"`
}

type PullResp

type PullResp struct {
	StatusCode int                 `json:"statusCode"`
	Body       []map[string]string `json:"message"`
}

Jump to

Keyboard shortcuts

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