agent

package
v0.0.0-...-9498627 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = viper.New()

Config is the global configuration varaible

View Source
var ErrorStatus = Status{400, "Request failed"}

ErrorStatus return on success

View Source
var Log boxlogger

Log Global Log variable

View Source
var SuccessStatus = Status{200, "Request succeed"}

SuccessStatus return on success

Functions

func CreateLogger

func CreateLogger(l Logger) (*logrus.Logger, error)

CreateLogger create a new logrus Logger object

func CreateServer

func CreateServer()

CreateServer create websocket server

func InitConfig

func InitConfig()

InitConfig set configuration

Types

type EventCode

type EventCode int

EventCode type

const (

	// Info event
	Info EventCode
	// Script event
	Script
	// Command event
	Command
)

func (EventCode) MarshalJSON

func (ec EventCode) MarshalJSON() ([]byte, error)

MarshalJSON return JSON

func (*EventCode) UnmarshalJSON

func (ec *EventCode) UnmarshalJSON(b []byte) error

UnmarshalJSON parse JSON

type Logger

type Logger struct {
	Type   string `mapstructure:"type"`
	Format string `mapstructure:"format"`
	Level  string `mapstructure:"level"`
	Path   string `mapstructure:"path"`
}

Logger object struct

type Status

type Status struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Status type

Jump to

Keyboard shortcuts

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