Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LEVELSYSTEM ... LEVELSYSTEM = "system" // LEVELPROJECT ... LEVELPROJECT = "project" // SCOPESYSTEM ... SCOPESYSTEM = "/system" // SCOPEPROJECT ... SCOPEPROJECT = "/project" // SCOPEALLPROJECT ... SCOPEALLPROJECT = "/project/*" // ROBOTTYPE ... ROBOTTYPE = "robotaccount" )
Variables ¶
View Source
var ( // Ctl is a global variable for the default robot account controller implementation Ctl = NewController() )
Functions ¶
func IsValidSec ¶
Types ¶
type Controller ¶
type Controller interface { // Get ... Get(ctx context.Context, id int64, option *Option) (*Robot, error) // Count returns the total count of robots according to the query Count(ctx context.Context, query *q.Query) (total int64, err error) // Create ... Create(ctx context.Context, r *Robot) (int64, string, error) // Delete ... Delete(ctx context.Context, id int64, option ...*Option) error // Update ... Update(ctx context.Context, r *Robot, option *Option) error // List ... List(ctx context.Context, query *q.Query, option *Option) ([]*Robot, error) }
Controller to handle the requests related with robot account
type Permission ¶
type Permission struct { Kind string `json:"kind"` Namespace string `json:"namespace"` Access []*types.Policy `json:"access"` Scope string `json:"-"` }
Permission ...
type Robot ¶
type Robot struct { model.Robot ProjectName string ProjectNameOrID interface{} Level string Editable bool `json:"editable"` Permissions []*Permission `json:"permissions"` }
Robot ...
func (*Robot) IsSysLevel ¶
IsSysLevel, true is a system level robot, others are project level.
Click to show internal directories.
Click to hide internal directories.