Documentation ¶
Overview ¶
Package common houses data structures and interfaces shared between gohstd and potential clients
Index ¶
Constants ¶
View Source
const InvalidBasicAuthError = `Basic Auth header was missing or malformed and could not be parsed`
View Source
const UserExistsError = `a user by that name already exists`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRepo ¶
type CommandRepo interface { // InsertInvocations writes Invocations to storage InsertInvocations(user string, invocs Invocations) (err error) // GetInvocations returns the [n] most recent Invocations for the given // user GetInvocations(user string, n int) (result Invocations, err error) // GetCommands returns the [n] most recent Commands for the given user GetCommands(user string, n int) (result Commands, err error) }
CommandRepo [sitory] is an interface wrapping the functions for working with command and invocation data
type Invocation ¶
type Invocation struct { Id int `json:"id"` Command string `json:"command"` Directory string `json:"directory"` User string `json:"user"` Host string `json:"host"` Shell string `json:"shell"` ExitCode int8 `json:"exitcode,string"` Timestamp time.Time `json:"timestamp"` Tags []string `json:"tags"` }
Invocation represents a single execution of a command, including its context, exit code and time of execution.
type Invocations ¶
type Invocations []Invocation
type User ¶
type UserRepo ¶
type UserRepo interface { // InsertUser commits a User to the storage, returning an error if the user // already exists InsertUser(user User, secret Secret) (err error) // GetUserByName queries the storage for a representation of a User, returning // nil and an error if the user does not exist GetUserByName(username string) (user User, err error) UpdateUserPicture(username string, location string) error }
UserRepo [sitory] is an interface wrapping the functions for working with user data
Source Files ¶
Click to show internal directories.
Click to hide internal directories.