config

package
v0.0.0-...-79aaa6a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTag

func CheckTag(cfg *Site, tag string) error

CheckTag ...

func File

func File() string

File ...

func Write

func Write(file string, cfg *Site) error

Write ...

Types

type Auth

type Auth struct {
	Level int
	Roles []string
}

Auth the authorization data

type Collection

type Collection struct {
	ID     string
	Name   string
	Active bool
	Types  []*Type
}

Collection ...

type Node

type Node struct {
	ID     string
	Active bool
	Name   string
	Path   string
	Auth   *Auth
	Subs   []*Node
	Res    []*Resources
}

Node the node config

func (*Node) BuildRoute

func (n *Node) BuildRoute(id string) []*Node

BuildRoute ...

func (*Node) Collect

func (n *Node) Collect() []*Node

Collect ...

func (*Node) FindNode

func (n *Node) FindNode(id string) *Node

FindNode ...

type Nodes

type Nodes struct {
	Root    *Node
	Signin  string
	Signout string
	Home    string
}

Nodes the nodes holder

func (*Nodes) BuildRoute

func (n *Nodes) BuildRoute(id string) []*Node

BuildRoute ...

func (*Nodes) FindNode

func (n *Nodes) FindNode(id string) *Node

FindNode ...

type Objects

type Objects struct {
	Stores []*Store
}

Objects the object stores holder

func (*Objects) FindCollection

func (o *Objects) FindCollection(store *Store, id string) *Collection

FindCollection ...

func (*Objects) FindStore

func (o *Objects) FindStore(id string) *Store

FindStore ...

func (*Objects) FindType

func (o *Objects) FindType(coll *Collection, id string) *Type

FindType ...

type Resources

type Resources struct {
	ID   string
	Name string
	Path string
}

Resources resources container

type Site

type Site struct {
	Tag     string
	Status  *Status
	Nodes   *Nodes
	Objects *Objects
}

Site the site config

func AddNode

func AddNode(cfg *Site, pID string, id string, name string, path string) (*Site, error)

AddNode ...

func AddObjectCollection

func AddObjectCollection(cfg *Site, storeID string, id string, name string, active bool) (*Site, error)

AddObjectCollection ...

func AddObjectStore

func AddObjectStore(cfg *Site, id string, name string, loc string, active bool) (*Site, error)

AddObjectStore ...

func AddObjectType

func AddObjectType(cfg *Site, storeID string, collID string, id string, name string, active bool) (*Site, error)

AddObjectType ...

func AddResources

func AddResources(cfg *Site, id string, resID string, name string, path string) (*Site, error)

AddResources ...

func DeleteResources

func DeleteResources(cfg *Site, id string, resID string) (*Site, error)

DeleteResources ...

func Parse

func Parse(file string) (*Site, error)

Parse the configuration

func RemoveNode

func RemoveNode(cfg *Site, pID string, id string) (*Site, error)

RemoveNode ...

func RemoveObjectCollection

func RemoveObjectCollection(cfg *Site, storeID string, id string) (*Site, error)

RemoveObjectCollection ...

func RemoveObjectStore

func RemoveObjectStore(cfg *Site, id string) (*Site, error)

RemoveObjectStore ...

func RemoveObjectType

func RemoveObjectType(cfg *Site, storeID string, collID string, id string) (*Site, error)

RemoveObjectType ...

func SetNode

func SetNode(cfg *Site, id string, active bool, name string, path string, level int, roles []string) (*Site, error)

SetNode ...

func SetResources

func SetResources(cfg *Site, id string, resID string, name string, path string) (*Site, error)

SetResources ...

func SetSiteStatus

func SetSiteStatus(cfg *Site, str string) (*Site, error)

SetSiteStatus ...

func UpdateObjectCollection

func UpdateObjectCollection(cfg *Site, storeID string, id string, name string, active bool) (*Site, error)

UpdateObjectCollection ...

func UpdateObjectStore

func UpdateObjectStore(cfg *Site, id string, name string, loc string, active bool) (*Site, error)

UpdateObjectStore ...

func UpdateObjectType

func UpdateObjectType(cfg *Site, storeID string, collID string, id string, name string, active bool) (*Site, error)

UpdateObjectType ...

type Status

type Status struct {
	Site int
}

Status the status holder

type Store

type Store struct {
	ID          string
	Name        string
	Location    string
	Active      bool
	Collections []*Collection
}

Store ...

type Tag

type Tag struct {
	Name string
	Type string
}

Tag ...

type Type

type Type struct {
	ID     string
	Name   string
	Active bool
	Tags   []*Tag
}

Type ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL