Documentation ¶
Overview ¶
Provide readonly access to superuser config specified during creation Thus the API doesn't allow creation of new superuser from it, nor does it allow deletion.
Index ¶
Constants ¶
View Source
const (
DefaultSuperAdmin = "superadmin"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SuperUser ¶
type SuperUserConfig ¶
type SuperUserConfig struct {
SuperUsers []*SuperUser `json:"super_users" yaml:"super_users" mapstructure:"super_users"`
}
type SuperUserIO ¶
type SuperUserIO struct {
// contains filtered or unexported fields
}
SuperUserIO queries superusers from a config under yaml / json format note that passwords are and should be encrypted
func NewSuperUserDAO ¶
func NewSuperUserDAO(superAdminFilePath string, logger logging.Logger) *SuperUserIO
NewSuperUserDAO creates SuperUserIO it checks whether or not the file exists, if it does it opens it readonly if it doesn't it creates a file containing default superuser and its password in a hashed format.
func (*SuperUserIO) Get ¶
Get Superuser based on its / his / her name. will return SuperUser object and error if any
func (*SuperUserIO) GetFilepath ¶
func (s *SuperUserIO) GetFilepath() string
Click to show internal directories.
Click to hide internal directories.