Documentation ¶
Index ¶
- func ConstructSearchORFilter(sign string, names []string) string
- func CreateTask(r *http.Request) (*interfaces.TaskEntry, error)
- func CreateTaskFromRequest(resource string, userID string, req *deployerRequest) (*interfaces.TaskEntry, error)
- func CreateUser(r *http.Request) (*interfaces.UserEntry, error)
- func DeleteUserByID(r *http.Request) error
- func GetAllAppModules(parameters *APIParameters) ([]interfaces.AppModuleEntry, error)
- func GetAllTasks(parameters *APIParameters) ([]interfaces.TaskEntry, error)
- func GetAllUsers(parameters *APIParameters) ([]interfaces.UserEntry, error)
- func GetAppModuleByID(r *http.Request) (*interfaces.AppModuleEntry, error)
- func GetCompleteDeployersForResourceByName(resource string, name string) (*interfaces.TaskEntry, error)
- func GetDeployerByID(r *http.Request) (*interfaces.TaskEntry, error)
- func GetNodesData(filter string) map[string][]map[string]interface{}
- func GetResourceBySearch(index, val string, dontCutParseResult bool) ([]map[string]interface{}, error)
- func GetRolesData(Filter string, roles []string) map[string][]map[string]interface{}
- func GetUserByID(r *http.Request) (*interfaces.UserEntry, error)
- func GetUserBySession(r *http.Request) (*interfaces.UserEntry, error)
- func GetUserIsBlocked(r *http.Request) bool
- func ImplementToAppModuleInfo(module *interfaces.AppModuleEntry, updatedModule *moduleRequest)
- func ImplementToProfileUserInfo(profile *ProfileUserRequest, user *interfaces.UserEntry)
- func ImplementToUserUpdatedInfo(currentUserID string, user *interfaces.UserEntry, updatedUser *userRequest)
- func IsUserBlocked(w http.ResponseWriter, r *http.Request) bool
- func Logout(r *http.Request) error
- func SetAppKeyByID(r *http.Request) error
- func UpdateAppModuleByID(r *http.Request) error
- func UpdateCurrentUserProfile(r *http.Request) error
- func UpdateUserByID(r *http.Request) error
- type APIParameters
- type AuthenticationPing
- type AuthenticationSessionInfo
- type AuthenticationUserInfo
- type AuthenticationUserPermissions
- type Cookbook
- type KeyEntry
- type Node
- type NodeTaskRequest
- type ProfileUserInfo
- type ProfileUserRequest
- type Role
- type RoleTaskRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructSearchORFilter ¶
ConstructSearchORFilter constructing string like 'names[0] OR names[1] OR ... OR names[n]'
func CreateTask ¶
func CreateTask(r *http.Request) (*interfaces.TaskEntry, error)
CreateTask creates a task.
func CreateTaskFromRequest ¶
func CreateTaskFromRequest(resource string, userID string, req *deployerRequest) (*interfaces.TaskEntry, error)
CreateTaskFromRequest creating task that spec in fields of deployerRequest. Also check for task existing by resource and name.
func CreateUser ¶
func CreateUser(r *http.Request) (*interfaces.UserEntry, error)
CreateUser creates user in database.
func DeleteUserByID ¶
DeleteUserByID delete user from database.
func GetAllAppModules ¶
func GetAllAppModules(parameters *APIParameters) ([]interfaces.AppModuleEntry, error)
GetAllAppModules return modules information.
func GetAllTasks ¶
func GetAllTasks(parameters *APIParameters) ([]interfaces.TaskEntry, error)
GetAllTasks return tasks information.
func GetAllUsers ¶
func GetAllUsers(parameters *APIParameters) ([]interfaces.UserEntry, error)
GetAllUsers return users information.
func GetAppModuleByID ¶
func GetAppModuleByID( r *http.Request) (*interfaces.AppModuleEntry, error)
GetAppModuleByID return struct with module information. Information get by id.
func GetCompleteDeployersForResourceByName ¶
func GetCompleteDeployersForResourceByName(resource string, name string) (*interfaces.TaskEntry, error)
GetCompleteDeployersForResourceByName returns the timestamp of the last deployment task for the specified resource.
func GetDeployerByID ¶
func GetDeployerByID(r *http.Request) (*interfaces.TaskEntry, error)
GetDeployerByID return task with the specified ID.
func GetNodesData ¶
GetNodesData return a map with node information for each node, with filter.
func GetResourceBySearch ¶
func GetResourceBySearch(index, val string, dontCutParseResult bool) ([]map[string]interface{}, error)
GetResourceBySearch return list what contains list of Resource on the server with specified search.
func GetRolesData ¶
GetRolesData return a map with node information for each role, specified by roles[]
func GetUserByID ¶
func GetUserByID(r *http.Request) (*interfaces.UserEntry, error)
GetUserByID return struct with user information. Information get by id.
func GetUserBySession ¶
func GetUserBySession(r *http.Request) (*interfaces.UserEntry, error)
GetUserBySession return struct with user information. Information get by user from session.
func GetUserIsBlocked ¶
GetUserIsBlocked delete session.
func ImplementToAppModuleInfo ¶
func ImplementToAppModuleInfo( module *interfaces.AppModuleEntry, updatedModule *moduleRequest)
ImplementToAppModuleInfo implement some updated fields into AppModule's entry.
func ImplementToProfileUserInfo ¶
func ImplementToProfileUserInfo(profile *ProfileUserRequest, user *interfaces.UserEntry)
ImplementToProfileUserInfo implement all needed fields into user's entry.
func ImplementToUserUpdatedInfo ¶
func ImplementToUserUpdatedInfo(currentUserID string, user *interfaces.UserEntry, updatedUser *userRequest)
ImplementToUserUpdatedInfo implement some updated fields into user's entry.
func IsUserBlocked ¶
func IsUserBlocked(w http.ResponseWriter, r *http.Request) bool
IsUserBlocked checks if the user is locked.
func SetAppKeyByID ¶
SetAppKeyByID updates key information. Information update by id.
func UpdateAppModuleByID ¶
UpdateAppModuleByID updates module information. Information update by id
func UpdateCurrentUserProfile ¶
UpdateCurrentUserProfile updates user information. Information update by id.
func UpdateUserByID ¶
UpdateUserByID updates user information. Information update by id.
Types ¶
type APIParameters ¶
type APIParameters struct { Start int64 End int64 Sort string Order string Q string ID []string IncludeAllIntoParseResource bool }
APIParameters contains all parameter, which can be processing ftom url query.
func GetURLAPIParameters ¶
func GetURLAPIParameters(r *http.Request) *APIParameters
GetURLAPIParameters return APIParameters from url args.
type AuthenticationPing ¶
type AuthenticationPing struct { Authenticate bool `json:"authenticate"` NeedPasswordChange bool `json:"needPasswordChange"` }
AuthenticationPing contains is answer of question of user authenticate.
func CheckSession ¶
func CheckSession(r *http.Request) (*AuthenticationPing, error)
CheckSession will check the existence of the session.
type AuthenticationSessionInfo ¶
type AuthenticationSessionInfo struct {
Session string `json:"session"`
}
AuthenticationSessionInfo contains session information.
func Authenticate ¶
func Authenticate(r *http.Request) (*AuthenticationSessionInfo, error)
Authenticate is a function to authenticate a user.
type AuthenticationUserInfo ¶
type AuthenticationUserInfo struct { ID string `json:"id"` Username string `json:"username"` FullName string `json:"fullName"` Avatar string `json:"avatar"` LastLogin string `json:"lastLogin"` NeedPasswordChange bool `json:"needPasswordChange"` }
AuthenticationUserInfo contains user information.
func ExtractAuthenticationUserInfo ¶
func ExtractAuthenticationUserInfo( user *interfaces.UserEntry) *AuthenticationUserInfo
ExtractAuthenticationUserInfo extracts all needed fields from the user's record..
type AuthenticationUserPermissions ¶
type AuthenticationUserPermissions struct {
IsAdmin bool `json:"admin"`
}
AuthenticationUserPermissions contains admin flag.
func ExtractAuthenticationUserPermissions ¶
func ExtractAuthenticationUserPermissions( user *interfaces.UserEntry) *AuthenticationUserPermissions
ExtractAuthenticationUserPermissions extract permissions fields of user.
type Cookbook ¶
type Cookbook struct { ID string `json:"id"` Meta chef.CookbookVersions `json:"meta"` }
Cookbook is a structure describing cookbook.
func GetCookbooks ¶
func GetCookbooks(parameters *APIParameters) ([]Cookbook, error)
GetCookbooks returns cookbook list on server.
type KeyEntry ¶
KeyEntry is a struct describes application key.
func GetAllAppKeys ¶
func GetAllAppKeys(parameters *APIParameters) ([]KeyEntry, error)
GetAllAppKeys return all application keys.
type Node ¶
type Node struct { ID string `json:"id"` Date string `json:"date"` Data []map[string]interface{} `json:"data"` }
Node is a structure describing node.
func GetNodes ¶
func GetNodes(parameters *APIParameters) ([]Node, error)
GetNodes returns node list on server.
type NodeTaskRequest ¶
NodeTaskRequest for create task for node.
func CreateTaskForNode ¶
func CreateTaskForNode(r *http.Request) (*NodeTaskRequest, error)
CreateTaskForNode creates task by spec request.
type ProfileUserInfo ¶
type ProfileUserInfo struct { ID string `json:"id"` FullName string `json:"fullName"` Avatar string `json:"avatar"` Username string `json:"username,omitempty"` UserID string `json:"userID,omitempty"` }
ProfileUserInfo containы profile info.
func ExtractProfileUserInfo ¶
func ExtractProfileUserInfo( user *interfaces.UserEntry) *ProfileUserInfo
ExtractProfileUserInfo extract all needed fields from user's entry.
func GetUserProfileByID ¶
func GetUserProfileByID(r *http.Request) (*ProfileUserInfo, error)
GetUserProfileByID returns information about the user's profile. Information is requested by id.
func GetUserProfiles ¶
func GetUserProfiles(params *APIParameters) ([]ProfileUserInfo, error)
GetUserProfiles return user profile information. Information get only by id in url query.
type ProfileUserRequest ¶
type ProfileUserRequest struct { ProfileUserInfo Password string `json:"password"` }
ProfileUserRequest contains request of profile.
type Role ¶
type Role struct { ID string `json:"id"` Date string `json:"date"` Data []map[string]interface{} `json:"data"` }
Role is a structure describing role.
func GetRoles ¶
func GetRoles(parameters *APIParameters) ([]Role, error)
GetRoles returns role list on server.
type RoleTaskRequest ¶
RoleTaskRequest for create task for role.
func CreateTaskForRole ¶
func CreateTaskForRole(r *http.Request) (*RoleTaskRequest, error)
CreateTaskForRole creates task by spec request.