Documentation
¶
Index ¶
- func AllHostDataByName(store resourcedmaster_storage.Storer, id string, hostname string) (map[string]interface{}, error)
- func CommonDeleteById(store resourcedmaster_storage.Storer, daoType string, id string) error
- func CommonSaveById(store resourcedmaster_storage.Storer, daoType string, id string, data []byte) error
- func DeleteApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string) error
- func DeleteHostByAppId(store resourcedmaster_storage.Storer, id string, hostname string) error
- func DeleteHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string) error
- func DeleteUserByName(store resourcedmaster_storage.Storer, name string) error
- func GetHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string) ([]byte, error)
- func SaveApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string, data []byte) error
- func SaveHostByAppIdJson(store resourcedmaster_storage.Storer, id string, hostname string, data []byte) error
- func SaveHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string, ...) error
- type Application
- func AllApplications(store resourcedmaster_storage.Storer) ([]*Application, error)
- func GetApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string) (*Application, error)
- func GetApplicationById(store resourcedmaster_storage.Storer, id string) (*Application, error)
- func NewApplication(store resourcedmaster_storage.Storer, name string) (*Application, error)
- type Host
- type User
- func AllUsers(store resourcedmaster_storage.Storer) ([]*User, error)
- func GetUserByName(store resourcedmaster_storage.Storer, name string) (*User, error)
- func Login(store resourcedmaster_storage.Storer, name, password string) (*User, error)
- func NewAccessTokenUser(store resourcedmaster_storage.Storer, app *Application) (*User, error)
- func NewUser(store resourcedmaster_storage.Storer, name, password string) (*User, error)
- func NewUserGivenJson(store resourcedmaster_storage.Storer, jsonBody io.ReadCloser) (*User, error)
- func UpdateUserByNameGivenJson(store resourcedmaster_storage.Storer, name string, allowLevelUpdate bool, ...) (*User, error)
- func UpdateUserTokenByName(store resourcedmaster_storage.Storer, name string) (*User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllHostDataByName ¶
func AllHostDataByName(store resourcedmaster_storage.Storer, id string, hostname string) (map[string]interface{}, error)
AllHostDataByName returns a slice of all JSON data with application id + hostname as key.
func CommonDeleteById ¶
func CommonDeleteById(store resourcedmaster_storage.Storer, daoType string, id string) error
CommonDeleteById deletes dao data with Id as key.
func CommonSaveById ¶
func CommonSaveById(store resourcedmaster_storage.Storer, daoType string, id string, data []byte) error
CommonSaveById saves dao data in JSON format with Id as key.
func DeleteApplicationByAccessToken ¶
func DeleteApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string) error
DeleteApplicationByAccessToken returns error.
func DeleteHostByAppId ¶
func DeleteHostByAppId(store resourcedmaster_storage.Storer, id string, hostname string) error
DeleteHostByAppId delete host data in JSON format with app id and hostname as keys.
func DeleteHostDataByNameJson ¶
func DeleteHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string) error
DeleteHostDataByNameJson deletes reader data in JSON format with application id + host + path as key.
func DeleteUserByName ¶
func DeleteUserByName(store resourcedmaster_storage.Storer, name string) error
DeleteUserByName deletes user with name as key.
func GetHostDataByNameJson ¶
func GetHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string) ([]byte, error)
GetHostDataByNameJson returns reader data in JSON format with application id + host + path as key.
func SaveApplicationByAccessToken ¶
func SaveApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string, data []byte) error
SaveApplicationByAccessToken saves application data in JSON format with accessToken as key.
func SaveHostByAppIdJson ¶
func SaveHostByAppIdJson(store resourcedmaster_storage.Storer, id string, hostname string, data []byte) error
SaveHostByAppIdJson saves host data in JSON format with app id and hostname as keys.
func SaveHostDataByNameJson ¶
func SaveHostDataByNameJson(store resourcedmaster_storage.Storer, id string, host, path string, data []byte) error
SaveHostDataByNameJson saves reader data in JSON format with application id + host + path as key.
Types ¶
type Application ¶
type Application struct {
Id string
Name string
Enabled bool
// contains filtered or unexported fields
}
func AllApplications ¶
func AllApplications(store resourcedmaster_storage.Storer) ([]*Application, error)
AllApplications returns a slice of all Application structs.
func GetApplicationByAccessToken ¶
func GetApplicationByAccessToken(store resourcedmaster_storage.Storer, accessToken string) (*Application, error)
GetApplicationByAccessToken returns Application struct with name as key.
func GetApplicationById ¶
func GetApplicationById(store resourcedmaster_storage.Storer, id string) (*Application, error)
GetApplicationById returns Application struct with name as key.
func NewApplication ¶
func NewApplication(store resourcedmaster_storage.Storer, name string) (*Application, error)
NewApplication is constructor for Application struct.
func (*Application) Delete ¶
func (a *Application) Delete() error
type Host ¶
type Host struct {
ApplicationId string
Name string
Tags []string
NetworkInterfaces map[string]map[string]interface{}
// Data is filled in during Get() and not during Save().
Data map[string]interface{}
// contains filtered or unexported fields
}
func AllHosts ¶
func AllHosts(store resourcedmaster_storage.Storer, id string) ([]*Host, error)
AllHosts returns a slice of all Host structs.
func GetHostByAppId ¶
func GetHostByAppId(store resourcedmaster_storage.Storer, id string, hostname string) (*Host, error)
GetHostByAppId returns Host struct with app id and hostname as keys.
func (*Host) DeleteDataJson ¶
type User ¶
type User struct {
Id string
ApplicationId string
Name string
HashedPassword string
Level string
Type string
Token string
Enabled bool
// contains filtered or unexported fields
}
func AllUsers ¶
func AllUsers(store resourcedmaster_storage.Storer) ([]*User, error)
AllUsers returns a slice of all User structs.
func GetUserByName ¶
func GetUserByName(store resourcedmaster_storage.Storer, name string) (*User, error)
GetUserByName returns User struct with name as key.
func Login ¶
func Login(store resourcedmaster_storage.Storer, name, password string) (*User, error)
Login returns User struct after validating password.
func NewAccessTokenUser ¶
func NewAccessTokenUser(store resourcedmaster_storage.Storer, app *Application) (*User, error)
NewAccessTokenUser returns struct User with basic level permission.
func NewUser ¶
func NewUser(store resourcedmaster_storage.Storer, name, password string) (*User, error)
NewUser returns struct User with basic level permission.
func NewUserGivenJson ¶
func NewUserGivenJson(store resourcedmaster_storage.Storer, jsonBody io.ReadCloser) (*User, error)
NewUserGivenJson returns struct User.
func UpdateUserByNameGivenJson ¶
func UpdateUserByNameGivenJson(store resourcedmaster_storage.Storer, name string, allowLevelUpdate bool, jsonBody io.ReadCloser) (*User, error)
UpdateUserByNameGivenJson returns struct User.
func UpdateUserTokenByName ¶
func UpdateUserTokenByName(store resourcedmaster_storage.Storer, name string) (*User, error)
UpdateUserTokenByName returns struct User.