Documentation
¶
Index ¶
- type Admin
- func (a *Admin) ChangeUserName(args args, r *Response) error
- func (a *Admin) ChangeUserPassword(args args, r *Response) error
- func (a *Admin) DeleteUser(args args, r *Response) error
- func (a *Admin) GetUser(args args, r *Response) error
- func (a *Admin) GetUsers(args args, r *Response) error
- func (a *Admin) NewUser(args args, r *Response) error
- func (a *Admin) Start()
- func (a *Admin) Stop(wait bool)
- type Request
- type Response
- type StatusCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { State chan state // contains filtered or unexported fields }
Admin contains all necessary resources for an administration api. This includes unix connection resources and command handler information.
func (*Admin) ChangeUserName ¶
ChangeUserName changes a user's name
func (*Admin) ChangeUserPassword ¶
ChangeUserPassword changes a user's password.
func (*Admin) DeleteUser ¶
DeleteUser deletes a user
type Request ¶
type Request struct { Command string `json:"command"` Arguments args `json:"arguments"` }
Request represents a request made to the Admin API
type Response ¶
type Response struct { Status StatusCode `json:"status"` Error string `json:"error,omitempty"` Result interface{} `json:"result,optional"` }
Response represents a response given as a result of a request to the Admin API.
type StatusCode ¶
type StatusCode int
StatusCode represents the status of a request.
const ( // OK signals that the command was successful. OK StatusCode = iota // NotImplemented signals that the command requested // is not implemented by the service. NotImplemented // UnkownCommand signals that the requested command // could not be identified. UnkownCommand // BadRequest signals that the request is invalid. BadRequest // BadArgument signals that the some or all of the // given arguments are invalid. BadArgument // DatabaseError signals that the command failed due to // a database error. DatabaseError // InternalError signals that the command failed due to // other errors. InternalError )
Click to show internal directories.
Click to hide internal directories.