Documentation ¶
Index ¶
- Variables
- func AddapiKey(id, keytype string) error
- func Close()
- func CreateAgent(owner string) (string, error)
- func CreateScript(script *Script) error
- func CreateUser(user *User) error
- func CreateWebsite(website *Website) error
- func Decode(raw []byte, out interface{}) error
- func DeleteAgent(id, owner string) error
- func DeleteScript(name string) error
- func DeleteUser(id string) error
- func DeleteWebsite(name string) error
- func Encode(v interface{}) ([]byte, error)
- func GetSysteminfo(id string) (map[string]string, error)
- func GetapiKeys(id string) ([]string, error)
- func RemoveapiKey(id, key string) error
- func Start()
- func UpdateAgent(agent *Agent) error
- func UpdateScript(script *Script) error
- func UpdateSystemInfo(id string, systeminfo map[string]string) error
- func UpdateUser(userinfo map[string]string) error
- func UpdateWebsite(website *Website) error
- type Agent
- type Boltdb
- func (b *Boltdb) Close()
- func (b *Boltdb) Create(key, value, bucket []byte) error
- func (b *Boltdb) Delete(key, bucket []byte) error
- func (b *Boltdb) Open(path string) error
- func (b *Boltdb) Read(key, bucket []byte) ([]byte, error)
- func (b *Boltdb) ReadAll(bucket []byte) ([][]byte, error)
- func (b *Boltdb) Update(key, value, bucket []byte) error
- type Script
- type User
- type Website
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorNoBucket = errors.New("Bucket not found of that name") ErrorValueNotFound = errors.New("Cannot value with that key") ErrorNotExistToupdate = errors.New("key doesnot exist to update the value") ErrorAlreadyExist = errors.New("key already exist to update the value") )
View Source
var (
AgentBucketName = []byte("agents")
)
View Source
var DB = &Boltdb{}
View Source
var ScriptBucketName = []byte("scripts")
View Source
var (
UserBucketName = []byte("users")
)
View Source
var WebsiteBucketName = []byte("websites")
Functions ¶
func CreateAgent ¶
func CreateScript ¶
func CreateUser ¶
func CreateWebsite ¶
func DeleteAgent ¶
func DeleteScript ¶
func DeleteUser ¶
func DeleteWebsite ¶
func Encode ¶
Encode is unified way to serilize data, this way it might be easier to change encoding(json to gob/msgpack or protobuf?) without having to huntdown and change all serilization code
func GetapiKeys ¶
func RemoveapiKey ¶
func UpdateAgent ¶
func UpdateScript ¶
func UpdateUser ¶
func UpdateWebsite ¶
Types ¶
type Agent ¶
type Agent struct { ID string `json:"id"` Owner string `json:"owner"` LastLogin time.Time `json:"lastlogin,omitempty"` FirstAdded time.Time `json:"firstadded,omitempty"` SystemInfo map[string]string `json:"systeminfo,omitempty"` Active bool `json:"active,omitempty"` ActiveConnid wire.UID `json:"connid,omitempty` }
func GetAllAgents ¶
func GetAllUserAgents ¶
type Script ¶
type Script struct { Name string `json:"name"` Code string `json:"code"` Platform string `json:"platform"` Type string `json:"type"` Agent string `json:"agent"` User string `json:"user"` }
func GetAllScripts ¶
type User ¶
type User struct { ID string `json:"id"` Password string `json:"password,omitempty"` FullName string `json:"fullname,omitempty"` Email string `json:"email,omitempty"` SuperUser bool `json:"superuser,omitempty"` APIKeys []string `json:"apikey"` Agents []string `json:"agents"` Websites []string `json:"websites"` }
func GetAllUsers ¶
Click to show internal directories.
Click to hide internal directories.