cwapi

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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