sqlite

package
v0.0.0-...-38655de Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config string) (driver.Storager, error)

Types

type AppConfig

type AppConfig struct {
	Model
	Key   string `gorm:"unique;"`
	Value bool
}

type Collection

type Collection struct {
	Model
	Name      string     `gorm:"unique;"`
	Resources []Resource `gorm:"many2many:collection_resources;"`
}

type Config

type Config struct {
	DB *gorm.DB
}

func (*Config) AddCollection

func (c *Config) AddCollection(name string)

func (*Config) AddGroup

func (c *Config) AddGroup(name string)

func (*Config) AddPolicy

func (c *Config) AddPolicy(name, group, collection string)

func (*Config) AddResource

func (c *Config) AddResource(name, rtype, value, options string)

func (*Config) AddResourceToCollection

func (c *Config) AddResourceToCollection(collection, resource string)

func (*Config) AddUser

func (c *Config) AddUser(name string)

func (*Config) AddUserToGroup

func (c *Config) AddUserToGroup(group, user string)

func (*Config) CountCollection

func (c *Config) CountCollection() int

func (*Config) CountGroup

func (c *Config) CountGroup() int

func (*Config) CountPolicy

func (c *Config) CountPolicy() int

func (*Config) CountResource

func (c *Config) CountResource(rtype string) int

func (*Config) CountUser

func (c *Config) CountUser() int

func (*Config) End

func (c *Config) End()

func (*Config) FindCollection

func (c *Config) FindCollection(name string) bool

func (*Config) FindGroup

func (c *Config) FindGroup(name string) bool

func (*Config) FindPolicy

func (c *Config) FindPolicy(name string) bool

func (*Config) FindResource

func (c *Config) FindResource(name string) bool

func (*Config) FindUser

func (c *Config) FindUser(name string) bool

func (*Config) GetConfig

func (c *Config) GetConfig(name string) bool

func (*Config) GetResourceValues

func (c *Config) GetResourceValues(username, rType string) []types.Resource

func (*Config) ListCollections

func (c *Config) ListCollections(filter map[string]string) map[string][]string

func (*Config) ListConfigs

func (c *Config) ListConfigs(filter map[string]string) []types.Config

func (*Config) ListGroups

func (c *Config) ListGroups(filter map[string]string) map[string][]string

func (*Config) ListPolicies

func (c *Config) ListPolicies(filter map[string]string) []types.Policy

func (*Config) ListResources

func (c *Config) ListResources(filter map[string]string) map[types.Resource][]string

func (*Config) ListUsers

func (c *Config) ListUsers(filter map[string]string) map[string][]string

func (*Config) RemoveCollection

func (c *Config) RemoveCollection(name string) error

func (*Config) RemoveGroup

func (c *Config) RemoveGroup(name string) error

func (*Config) RemovePolicy

func (c *Config) RemovePolicy(name string)

func (*Config) RemoveResource

func (c *Config) RemoveResource(name string) error

func (*Config) RemoveResourceFromCollection

func (c *Config) RemoveResourceFromCollection(collection, resource string)

func (*Config) RemoveUser

func (c *Config) RemoveUser(name string) error

func (*Config) RemoveUserFromGroup

func (c *Config) RemoveUserFromGroup(group, user string)

func (*Config) SetConfig

func (c *Config) SetConfig(name string, value bool)

type Group

type Group struct {
	Model
	Name  string `gorm:"unique;"`
	Users []User `gorm:"many2many:group_users;"`
}

type Model

type Model struct {
	ID        uint      `gorm:"primary_key"`
	CreatedAt time.Time `gorm:"created_at"`
}

type Policy

type Policy struct {
	Model
	Name         string `gorm:"unique;"`
	Group        Group
	GroupID      uint
	Collection   Collection
	CollectionID uint
}

type Resource

type Resource struct {
	Model
	Name   string `gorm:"unique;"`
	Type   string
	Value  string
	Option string
}

type User

type User struct {
	Model
	Name string `gorm:"unique;"`
}

Jump to

Keyboard shortcuts

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