model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	FindUserByID(int) map[string]UserGroup
	FindUserByName(string) map[string]UserGroup
	FindGroupByID(int) map[string]UserGroup
	FindGroupByName(string) map[string]UserGroup
	Users() map[string]UserGroup
	Groups() map[string]UserGroup
	HighestUserID() int
	LowestUserID() int
	HighestGroupID() int
	LowestGroupID() int
}

type BackendTomlFile

type BackendTomlFile struct {
	// contains filtered or unexported fields
}

func NewBackendTomlFile

func NewBackendTomlFile(u *Users, g *Groups) (*BackendTomlFile, error)

func (BackendTomlFile) FindGroupByID

func (t BackendTomlFile) FindGroupByID(id int) map[string]UserGroup

func (BackendTomlFile) FindGroupByName

func (t BackendTomlFile) FindGroupByName(name string) map[string]UserGroup

func (BackendTomlFile) FindUserByID

func (t BackendTomlFile) FindUserByID(id int) map[string]UserGroup

func (BackendTomlFile) FindUserByName

func (t BackendTomlFile) FindUserByName(name string) map[string]UserGroup

func (BackendTomlFile) Groups

func (t BackendTomlFile) Groups() map[string]UserGroup

func (BackendTomlFile) HighestGroupID

func (t BackendTomlFile) HighestGroupID() int

func (BackendTomlFile) HighestUserID

func (t BackendTomlFile) HighestUserID() int

func (BackendTomlFile) LowestGroupID

func (t BackendTomlFile) LowestGroupID() int

func (BackendTomlFile) LowestUserID

func (t BackendTomlFile) LowestUserID() int

func (BackendTomlFile) Users

func (t BackendTomlFile) Users() map[string]UserGroup

type Base

type Base struct {
	ID   int    `toml:"id" json:"id"`
	Name string `toml:"name" json:"name"`
}

type Group

type Group struct {
	Base
	Users      []string `toml:"users" json:"users"`
	LinkGroups []string `toml:"link_groups" json:"-"`
}

type Groups

type Groups map[string]*Group

func (*Groups) ToUserGroup

func (gs *Groups) ToUserGroup() map[string]UserGroup

type User

type User struct {
	Base
	Password      string   `toml:"password" json:"password"`
	GroupID       int      `toml:"group_id" json:"group_id"`
	Directory     string   `toml:"directory" json:"directory"`
	Shell         string   `toml:"shell" json:"shell"`
	Gecos         string   `toml:"gecos" json:"gecos"`
	Keys          []string `toml:"keys" json:"keys"`
	LinkUsers     []string `toml:"link_users" json:"-"`
	SetupCommands []string `toml:"setup_commands" json:"setup_commands"`
}

type UserGroup

type UserGroup interface {
	// contains filtered or unexported methods
}

type Users

type Users map[string]*User

func (*Users) ToUserGroup

func (us *Users) ToUserGroup() map[string]UserGroup

Jump to

Keyboard shortcuts

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