users

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserGenHandler

func UserGenHandler(generator Type) interface{}

Types

type CircularUsers

type CircularUsers struct {
	UserList  []*User  `json:"userlist" displayname:"User list"`
	Password  Password `json:"password,omitempty" displayname:"Password"`
	Directory string   `json:"directory,omitempty" displayname:"User directory"`
	// contains filtered or unexported fields
}

func NewCircularUsers

func NewCircularUsers() *CircularUsers

NewCircularUsers creates a circular list of users

func (*CircularUsers) Iterate

func (users *CircularUsers) Iterate(iteration uint64) *User

Iterate returns the next user in a circular manner, iteration should always be > 0

func (*CircularUsers) Validate

func (users *CircularUsers) Validate() error

Validate validates settings

type GeneratorCore

type GeneratorCore struct {
	GeneratorType Type `json:"type" displayname:"User generator type" doc-key:"config.loginSettings.type"`
}

type NoneUsers

type NoneUsers struct {
}

func (*NoneUsers) Iterate

func (users *NoneUsers) Iterate(iteration uint64) *User

Iterate returns the next user in a circular manner

func (*NoneUsers) Validate

func (users *NoneUsers) Validate() error

Validate validates settings

type Password

type Password string

Password

func (*Password) MarshalJSON

func (passwd *Password) MarshalJSON() ([]byte, error)

MarshalJSON marshal password to json: replace with ***

func (*Password) UnmarshalJSON

func (passwd *Password) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal password from json

type PrefixUsers

type PrefixUsers struct {
	Prefix    string `json:"prefix" displayname:"Prefix" doc-key:"config.loginSettings.settings.prefix"`
	Directory string `json:"directory,omitempty" displayname:"User directory" doc-key:"config.loginSettings.settings.directory"`
}

func (*PrefixUsers) Iterate

func (users *PrefixUsers) Iterate(iteration uint64) *User

Iterate returns the next user in a circular manner

func (*PrefixUsers) Validate

func (users *PrefixUsers) Validate() error

Validate validates settings

type Settings

type Settings interface {
	Iterate(iteration uint64) *User
	Validate() error
}

Settings interface to be implemented by user generator

type Type

type Type int

Type type of scheduler

const (
	// UserGeneratorUnknown unknown user generator
	UserGeneratorUnknown Type = iota
	// UserGeneratorCircular users according to userlist
	UserGeneratorCircular
	// UserGeneratorPrefix users with a prefix and an enumeration
	UserGeneratorPrefix
	// UserGeneratorNone no user creation
	UserGeneratorNone
)

func (Type) GetEnumMap

func (value Type) GetEnumMap() *enummap.EnumMap

func (Type) MarshalJSON

func (value Type) MarshalJSON() ([]byte, error)

MarshalJSON marshal scheduler type to json

func (*Type) UnmarshalJSON

func (value *Type) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal user generator type from json

type User

type User struct {
	UserName  string   `json:"username" displayname:"Username"`
	Password  Password `json:"password,omitempty" displayname:"Password"`
	Directory string   `json:"directory,omitempty" displayname:"User directory"`
}

type UserGenerator

type UserGenerator struct {
	GeneratorCore
	Settings Settings `json:"settings" doc-key:"config.loginSettings.settings"`
}

UserGenerator of users

func NewUserGeneratorCircular

func NewUserGeneratorCircular(users []*User) UserGenerator

NewUserGeneratorCircular create new circular user generator

func NewUserGeneratorNone

func NewUserGeneratorNone() UserGenerator

NewUserGeneratorNone create new "none" user generator (to be used with e.g. Qlik Core)

func NewUserGeneratorPrefix

func NewUserGeneratorPrefix(prefix string) UserGenerator

NewUserGeneratorPrefix create new prefix user generator

func (*UserGenerator) GetNext

func (value *UserGenerator) GetNext(counters *statistics.ExecutionCounters) *User

GetNext user to simulate

func (*UserGenerator) UnmarshalJSON

func (value *UserGenerator) UnmarshalJSON(arg []byte) error

UnmarshalJSON unmarshal scheduler from json

Jump to

Keyboard shortcuts

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