core

package
v0.0.0-...-b817d74 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build string
View Source
var TraceMe = &Tracer{ui: createUI(), level: 0}
View Source
var Version = version{1, 2, 3, "dev", "Chuck Norris"}

Functions

func GetCurrentPath

func GetCurrentPath() string

func GetMacAddress

func GetMacAddress() string

func GetOutboundIP

func GetOutboundIP() net.IP

https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go Get preferred outbound ip of this machine

func GetTempFolder

func GetTempFolder() string

func GetUUID

func GetUUID() string

func Response2Json

func Response2Json(r *http.Response) string

func SetupManager

func SetupManager()

func UnZip

func UnZip(src string, dest string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

Types

type ApiDef

type ApiDef struct {
	Name   string `json:"name"`
	Url    string `json:"url"`
	Route  string `json:"route"`
	Method string `json:"method"`

	Parameters map[string]interface{} `json:"parameters"`
	Headers    map[string]interface{} `json:"headers"`
	Body       map[string]interface{} `json:"body"`
	Response   string                 `json:"response"`

	Extra map[string]interface{} `json:"extra"`
}

func NewApiDef

func NewApiDef() *ApiDef

func (*ApiDef) Put

func (a *ApiDef) Put(k string, v interface{}) bool

type CLI

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

func NewCLI

func NewCLI(options ...CLIOption) (*CLI, error)

func (*CLI) Exec

func (c *CLI) Exec(cmd string, data string)

type CLIOption

type CLIOption func(*CLI)

func DataOption

func DataOption(data string) CLIOption

func LoginOption

func LoginOption(u string, p string) CLIOption

func SpaceOption

func SpaceOption(space *SpaceData) CLIOption

type Config

type Config struct {
	Space *SpaceData `json:"space"`
}

type EmbedData

type EmbedData struct {
	Effect int `json:"effect"`
}

type KitService

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

type RequestData

type RequestData struct {
	Space *SpaceData `json:"space"`
	Cmd   string     `json:"cmd"`
	Data  string     `json:"data"`
}

type ResponseData

type ResponseData struct {
	Success bool       `json:"success"`
	Data    *EmbedData `json:"data"`
}

type SpaceData

type SpaceData struct {
	Token     string `json:"token"`
	Name      string `json:"name"`
	Timestamp string `json:"timestamp,omitempty"`
	Desc      string `json:"desc"`
}

func LocalSpaceData

func LocalSpaceData(path string) *SpaceData

func NewSpaceData

func NewSpaceData(token string, name string) *SpaceData

type Tracer

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

func (*Tracer) Debug

func (t *Tracer) Debug(format string, args ...interface{})

func (*Tracer) Error

func (t *Tracer) Error(format string, args ...interface{})

func (*Tracer) Info

func (t *Tracer) Info(format string, args ...interface{})

func (*Tracer) SetDebugMode

func (t *Tracer) SetDebugMode(d bool) *Tracer

Jump to

Keyboard shortcuts

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