Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusOK Status = "OK" StatusItemNotFound = "ItemNotFound" StatusError = "Error" StatusQueryNotUnique = "QueryNotUnique" )
Variables ¶
View Source
var ( ResultOK = Result{Status: StatusOK, Result: nil, Error: nil} ErrorCmdNotFound = errrs.New("Command not found!") ErrorNotAllowed = errrs.New("You are not allowed to do that!") ErrorNotLoggedIn = errrs.New("You are not allowed to do that; you need to be logged in!") ErrorNotImplemented = errrs.New("Sorry, this feature is not implemented yet.") ErrorUserNotFound = errrs.New("User not found!") ErrorInvalidQuery = errrs.New("Invalid Query!") )
Functions ¶
This section is empty.
Types ¶
type CommandContext ¶
type Core ¶
type Core interface { Start() error Shutdown() error Version() string RegisterCommand(Command) UnregisterCommand(Command) CmdLine() Cmd(ctx CommandContext) Result IsCmdAllowed(level AuthLevel, cmd string) (bool, error) // Long-running jobs can use this method to register a shutdown handler. // Returned is a channel which should be listened on. // // When the core is shut down, it will first send a SignalTerminate to each // registered job, then wait a few seconds, and then send a SignalKill. // After the SignalKill is received, the goroutine will be killed. // If necessary, the killing can be delayed by not listening on the channel // anymore after receiving the SignalTerminate. Don't wait for too long, // though. RegisterJob() <-chan JobSignal // Use this to unregister your job once it's finished. UnregisterJob(job <-chan JobSignal) }
Click to show internal directories.
Click to hide internal directories.