users

package
v0.17.11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultUserfileSeparator = ";"
)

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  helpers.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 CircularUsersFile added in v0.11.4

type CircularUsersFile struct {
	CircularUsersFileCore
	// contains filtered or unexported fields
}

func NewCircularUsersFromFile added in v0.11.4

func NewCircularUsersFromFile() *CircularUsersFile

NewCircularUsersFromFile populate user list from file

func (*CircularUsersFile) Iterate added in v0.11.4

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

Iterate users from file

func (*CircularUsersFile) UnmarshalJSON added in v0.11.4

func (users *CircularUsersFile) UnmarshalJSON(arg []byte) error

UnmarshalJSON CircularUsersFile

func (*CircularUsersFile) Validate added in v0.11.4

func (users *CircularUsersFile) Validate() error

Validate CircularUsersFile settings

type CircularUsersFileCore added in v0.11.4

type CircularUsersFileCore struct {
	Filename  helpers.RowFile  `json:"filename" displayname:"Filename"  displayelement:"file"`
	Password  helpers.Password `json:"password,omitempty" displayname:"Password"`
	Directory string           `json:"directory,omitempty" displayname:"User directory"`
}

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 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
	// UserGeneratorCircularFile userlist read from file
	UserGeneratorCircularFile
)

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) String added in v0.11.4

func (value Type) String() string

String implements stringer interface

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  helpers.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