Documentation ¶
Index ¶
- Constants
- func Register(match string, priority int, hdlr Handler)
- type Config
- func (c *Config) AddSpace(spaces ...*Space) *Config
- func (lis Config) EnvString() string
- func (lis Config) IniString() string
- func (lis Config) Len() int
- func (lis Config) Less(i, j int) bool
- func (lis Config) String() string
- func (lis Config) StringList() string
- func (lis Config) Swap(i, j int)
- func (lis Config) ToSpaceMap() SpaceMap
- type GraphMercury
- func (GraphMercury) Config(ctx context.Context, search *string, query *gql.QueryInput) (lis []*Space, err error)
- func (GraphMercury) Value(ctx context.Context, value *Value) (string, error)
- func (GraphMercury) WriteConfig(ctx context.Context, config []*Space) (result string, err error)
- func (g GraphMercury) WriteConfigText(ctx context.Context, config string) (result string, err error)
- type Handler
- type HandlerItem
- type HandlerList
- func (hl HandlerList) GetIndex(match, search string) (lis Config)
- func (hl HandlerList) GetNotify(event string) (lis ListNotify, err error)
- func (hl HandlerList) GetObjects(match, search, fields string) (out Config)
- func (hl HandlerList) GetRules(user ident.Ident) (lis Rules)
- func (hl HandlerList) Len() int
- func (hl HandlerList) Less(i, j int) bool
- func (hl HandlerList) String() string
- func (hl HandlerList) Swap(i, j int)
- func (hl HandlerList) WriteObjects(spaces Config) error
- type ListNotify
- type NamespaceNode
- type NamespaceSearch
- type NamespaceSpec
- type NamespaceStar
- type NamespaceTrace
- type Notify
- type Roles
- type Rule
- type Rules
- type Space
- func (s *Space) AddKeys(keys ...*Value) *Space
- func (s *Space) AddNotes(notes ...string) *Space
- func (s *Space) AddTags(tags ...string) *Space
- func (s Space) FirstTagMeta(needle string) string
- func (s Space) FirstValue(name string) Value
- func (s Space) GetTagMeta(needle string, offset int) string
- func (s Space) GetValues(name string) (lis []Value)
- func (s Space) HasTag(needle string) bool
- func (s *Space) SetKeys(keys ...*Value) *Space
- func (s *Space) SetNotes(notes ...string) *Space
- func (s *Space) SetTags(tags ...string) *Space
- type SpaceMap
- type Value
- func (v *Value) AddNotes(notes ...string) *Value
- func (v *Value) AddTags(tags ...string) *Value
- func (v *Value) AddValues(values ...string) *Value
- func (v Value) First() string
- func (v Value) FirstTagMeta(needle string) string
- func (v Value) GetTagMeta(needle string, offset int) string
- func (v Value) HasTag(needle string) bool
- func (v Value) Join() string
- func (v *Value) SetNotes(notes ...string) *Value
- func (v *Value) SetTags(tags ...string) *Value
- func (v *Value) SetValues(values ...string) *Value
Constants ¶
const ( TypeNamespaceNode = "node" TypeNamespaceStar = "star" TypeNamespaceTrace = "trace" )
Namespace Spec types
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config []*Space
func (Config) StringList ¶
StringList returns the space names as a list
type GraphMercury ¶
type GraphMercury struct{}
GraphMercury implements the resolvers for gqlgen
func (GraphMercury) Config ¶
func (GraphMercury) Config(ctx context.Context, search *string, query *gql.QueryInput) (lis []*Space, err error)
Config returns a list of config items
func (GraphMercury) Value ¶
Value returns a joined value
func (GraphMercury) WriteConfig ¶
WriteConfig saves a space and attributes to database
type Handler ¶
type Handler interface { GetIndex(NamespaceSearch, *rsql.Program) Config GetObjects(NamespaceSearch, *rsql.Program, []string) Config WriteObjects(Config) error GetRules(ident.Ident) Rules GetNotify(string) ListNotify }
Handler interface for backends
type HandlerItem ¶
HandlerItem a single handler matching
func (HandlerItem) String ¶
func (h HandlerItem) String() string
type HandlerList ¶
type HandlerList []HandlerItem
HandlerList a list of handlers
var Registry HandlerList
Registry handler
func (HandlerList) GetIndex ¶
func (hl HandlerList) GetIndex(match, search string) (lis Config)
GetIndex query each handler that match namespace.
func (HandlerList) GetNotify ¶
func (hl HandlerList) GetNotify(event string) (lis ListNotify, err error)
GetNotify query each of the handlers for rules.
func (HandlerList) GetObjects ¶
func (hl HandlerList) GetObjects(match, search, fields string) (out Config)
GetObjects query each handler that match for fully qualified namespaces.
func (HandlerList) GetRules ¶
func (hl HandlerList) GetRules(user ident.Ident) (lis Rules)
GetRules query each of the handlers for rules.
func (HandlerList) Less ¶
func (hl HandlerList) Less(i, j int) bool
Less implements Less for sort.interface
func (HandlerList) String ¶
func (hl HandlerList) String() string
func (HandlerList) Swap ¶
func (hl HandlerList) Swap(i, j int)
Swap implements Swap for sort.interface
func (HandlerList) WriteObjects ¶
func (hl HandlerList) WriteObjects(spaces Config) error
WriteObjects write objects to backends
type ListNotify ¶
type ListNotify []Notify
ListNotify array of notify
func (ListNotify) Find ¶
func (ln ListNotify) Find(name string) (lis ListNotify)
Find returns list of notify that match name.
type NamespaceNode ¶
type NamespaceNode string
NamespaceNode implements a node search value
func (NamespaceNode) Match ¶
func (n NamespaceNode) Match(s string) bool
Match returns true if any match.
type NamespaceSearch ¶
type NamespaceSearch []NamespaceSpec
NamespaceSearch list of namespace specs
func ParseNamespace ¶
func ParseNamespace(ns string) (lis NamespaceSearch)
ParseNamespace returns a list of parsed values
func (NamespaceSearch) Match ¶
func (n NamespaceSearch) Match(s string) bool
Match returns true if any match.
type NamespaceSpec ¶
type NamespaceSpec interface { Type() string Value() string String() string Raw() string Match(string) bool }
NamespaceSpec implements a parsed namespace search
func NewNamespace ¶
func NewNamespace(ns, t string) NamespaceSpec
NewNamespace returns requested type that implements NamespaceSpec
type NamespaceStar ¶
type NamespaceStar string
NamespaceStar implements a trace search value
func (NamespaceStar) Match ¶
func (n NamespaceStar) Match(s string) bool
Match returns true if any match.
type NamespaceTrace ¶
type NamespaceTrace string
NamespaceTrace implements a trace search value
func (NamespaceTrace) Match ¶
func (n NamespaceTrace) Match(s string) bool
Match returns true if any match.
type Notify ¶
Notify stores the attributes for a registry space
type Rule ¶
Rule is a type of rule
type Rules ¶
type Rules []Rule
Rules is a list of rules
func (Rules) CheckNamespace ¶
func (r Rules) CheckNamespace(search NamespaceSearch) bool
CheckNamespace verifies user has access
func (Rules) GetNamespaceSearch ¶
func (r Rules) GetNamespaceSearch() (lis NamespaceSearch)
GetNamespaceSearch returns a default search for users rules.
func (Rules) GetRoles ¶
GetRoles returns a list of Roles
func (Rules) ReduceSearch ¶
func (r Rules) ReduceSearch(search NamespaceSearch) (out NamespaceSearch)
ReduceSearch verifies user has access
type Space ¶
type Space struct { ID uint64 `json:"-"` Space string `json:"space"` Tags []string `json:"tags"` Notes []string `json:"notes"` List []Value `json:"list"` }
Space stores a registry of spaces
func (Space) FirstTagMeta ¶
FirstTagMeta returns the first meta tag value.
func (Space) GetTagMeta ¶
GetTagMeta retuns the value after a '/' in a tag. Tags are in the format 'name' or 'name/value' This function returns the value.
func (Space) GetValues ¶
GetValues that match name
func (Space) HasTag ¶
HasTag returns true if needle is found If the needle ends with a / it will be treated as a prefix for tag meta data.
type SpaceMap ¶
SpaceMap generic map of space values
type Value ¶
type Value struct { Seq uint64 `json:"-"` Name string `json:"name"` Values []string `json:"values"` Notes []string `json:"notes"` Tags []string `json:"tags"` }
Value stores the attributes for space values
func (Value) FirstTagMeta ¶
FirstTagMeta returns the first meta tag value.
func (Value) GetTagMeta ¶
GetTagMeta retuns the value after a '/' in a tag. Tags are in the format 'name' or 'name/value' This function returns the value.
func (Value) HasTag ¶
HasTag returns true if needle is found If the needle ends with a / it will be treated as a prefix for tag meta data.