Documentation ¶
Index ¶
- Variables
- func AddUserToGroup(ctx context.Context, group, user string) error
- func ClearAccess(ctx context.Context, tx *sql.Tx, nodeID int) error
- func CreateGroup(ctx context.Context, name string) error
- func CreateParameter(ctx context.Context, path, contentType, value string, ...) error
- func DeleteAccess(ctx context.Context, path, group string) error
- func DeleteGroup(ctx context.Context, name string) error
- func DeleteParameter(ctx context.Context, path string, version int, comment string) error
- func DeleteServerStatus(ctx context.Context, host string) error
- func DeleteUserFromGroup(ctx context.Context, group, user string) error
- func Initialize(config AdminConfig)
- func LogLastVersion(ctx context.Context, tx *sql.Tx, path, comment string) error
- func MoveParameter(ctx context.Context, path string, newPath string, symlink bool, version int, ...) error
- func NewHeaderAuthenticator(config HeaderAuthenticatorConfig) *headerAuthenticator
- func NewMySQLAuthenticator(config MySQLAuthenticatorConfig) *mysqlAuthenticator
- func RegisterRoutes(r *mux.Router)
- func RootUsersOnly(next http.Handler) http.Handler
- func SelectChildren(ctx context.Context, params []*ParameterWithChildren) error
- func SelectGroupUsers(ctx context.Context, group string) ([]string, error)
- func SelectGroups(ctx context.Context) ([]string, error)
- func SelectSubtree(ctx context.Context, params []*ParameterWithSubtree) error
- func SelectWithChildrenMulti(ctx context.Context, paths []string) (map[string]*ParameterWithChildren, error)
- func SetAccess(ctx context.Context, path, group string, rw NullBool) error
- func SetParameter(ctx context.Context, path string, version int, contentType string, ...) error
- func SetParameterDescription(ctx context.Context, path string, summary, description string) error
- func SetParameterNotification(ctx context.Context, path string, notification string) error
- func UserCanEditAccess(ctx context.Context, user, path string) (bool, error)
- func UserIsRoot(ctx context.Context, user string) (bool, error)
- type Access
- type AdminConfig
- type Authenticator
- type AuthenticatorConfig
- type Avatar
- type HeaderAuthenticatorConfig
- type LogEntry
- type LogFilter
- type MySQLAuthenticatorConfig
- type Parameter
- func SearchParameters(ctx context.Context, term string) ([]Parameter, error)
- func SelectParameter(ctx context.Context, path string) (*Parameter, error)
- func SelectParameterFollowingSymlink(ctx context.Context, path string) (*Parameter, error)
- func SelectParameterResolvingSymlink(ctx context.Context, path string) (*Parameter, error)
- type ParameterWithChildren
- type ParameterWithDescendants
- type ParameterWithSubtree
- type ServerStatus
- type UIConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccessDenied = errors.New("Access denied") ErrAlreadyExists = errors.New("Parameter already exists") ErrVersionNotMatch = errors.New("Version not match") ErrCommentRequired = errors.New("Comment required") ErrInvalidValue = errors.New("Invalid value") ErrNotEmpty = errors.New("Parameter has children") ErrNotFound = errors.New("Parameter not found") ErrParentNotFound = errors.New("Parent not found") )
View Source
var ErrNoSuchVersion = errors.New("no such version")
Functions ¶
func CreateParameter ¶
func DeleteParameter ¶
func Initialize ¶
func Initialize(config AdminConfig)
func LogLastVersion ¶
func MoveParameter ¶
func NewHeaderAuthenticator ¶
func NewHeaderAuthenticator(config HeaderAuthenticatorConfig) *headerAuthenticator
func NewMySQLAuthenticator ¶
func NewMySQLAuthenticator(config MySQLAuthenticatorConfig) *mysqlAuthenticator
func RegisterRoutes ¶
func SelectChildren ¶
func SelectChildren(ctx context.Context, params []*ParameterWithChildren) error
func SelectSubtree ¶
func SelectSubtree(ctx context.Context, params []*ParameterWithSubtree) error
func SelectWithChildrenMulti ¶
func SetParameter ¶
func SetParameterDescription ¶
func UserCanEditAccess ¶
Types ¶
type Access ¶
type AdminConfig ¶
type AdminConfig struct { Auth AuthenticatorConfig NotificationDatabase DatabaseConfig `yaml:"notification_database"` }
type Authenticator ¶
type AuthenticatorConfig ¶
type AuthenticatorConfig struct { Method string MySQLAuth MySQLAuthenticatorConfig `yaml:",inline"` HeaderAuth HeaderAuthenticatorConfig `yaml:",inline"` Realm string }
type Avatar ¶
type Avatar struct { URI string `json:"uri"` Domain string `json:"domain"` Gravatar bool `json:"gravatar"` Extension string `json:"extension"` Rename map[string]string `json:"rename,omitempty"` Link *struct { URI string `json:"uri"` Rename map[string]string `json:"rename,omitempty"` } `json:"link,omitempty"` }
type LogEntry ¶
type LogEntry struct { ID int `json:"id"` NodeID int `json:"-"` Path string `json:"path"` Version int `json:"version"` ContentType string `json:"mime"` Value NullString `json:"data"` MTime string `json:"mtime"` Author string `json:"author"` Comment NullString `json:"comment"` Deleted bool `json:"deleted"` RW NullBool `json:"rw"` Same bool `json:"same"` }
type Parameter ¶
type Parameter struct { ID int `json:"-"` Name string `json:"name"` ParentID sql.NullInt64 `json:"-"` Path string `json:"path"` Value NullString `json:"data"` ContentType string `json:"mime"` Summary string `json:"summary"` Description string `json:"description"` Version int `json:"version"` MTime string `json:"mtime"` Deleted bool `json:"-"` NumChildren int `json:"num_children"` AccessModified bool `json:"access_modified"` RW NullBool `json:"rw"` Notification string `json:"notification"` NotificationModified bool `json:"notification_modified"` }
func SearchParameters ¶
func (*Parameter) WithChildren ¶
func (p *Parameter) WithChildren(ctx context.Context) (*ParameterWithChildren, error)
func (*Parameter) WithSubtree ¶
func (p *Parameter) WithSubtree(ctx context.Context) (*ParameterWithSubtree, error)
type ParameterWithChildren ¶
func (*ParameterWithChildren) AddChild ¶
func (p *ParameterWithChildren) AddChild(child Parameter)
func (*ParameterWithChildren) GetParameter ¶
func (p *ParameterWithChildren) GetParameter() *Parameter
type ParameterWithSubtree ¶
type ParameterWithSubtree struct { Parameter Children []ParameterWithSubtree `json:"children"` }
func (*ParameterWithSubtree) AddChild ¶
func (p *ParameterWithSubtree) AddChild(child Parameter)
func (*ParameterWithSubtree) GetParameter ¶
func (p *ParameterWithSubtree) GetParameter() *Parameter
type ServerStatus ¶
type ServerStatus struct { Host string `json:"host"` MTime NullString `json:"mtime"` Online string `json:"online"` Package string `json:"package"` MTimeAlert bool `json:"mtime_alert"` OnlineAlert bool `json:"online_alert"` }
func SelectServerStatus ¶
func SelectServerStatus(ctx context.Context, sort string) ([]ServerStatus, error)
Click to show internal directories.
Click to hide internal directories.