manager

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlarmDel

func AlarmDel(idx string) error

func AlarmGen

func AlarmGen(alarm nerr.PublicAlarm, isRecovery bool, ext ...string) error

func AlarmTag

func AlarmTag(idx string, tag string) error

func AuditDel

func AuditDel(idx string) error

func AuditGen

func AuditGen(user string, opt string, obj string, address string, result ...string) error

func UserAdd

func UserAdd(name string, pwd string) error

func UserUpdate

func UserUpdate(name string, pwd string) error

Types

type Alarm

type Alarm struct {
	Idx    string `json:"idx"`
	ID     int    `json:"id"`
	Date   string `json:"date"`
	Type   string `json:"type"`
	Level  string `json:"level"`
	Detail string `json:"detail"`
	Status string `json:"status"`
	Tag    string `json:"tag"`
}

func AlarmAllGet

func AlarmAllGet() ([]*Alarm, error)

func AlarmGet

func AlarmGet(idx string) (*Alarm, error)

type AlarmType

type AlarmType []*Alarm

func (AlarmType) Len

func (a AlarmType) Len() int

func (AlarmType) Less

func (a AlarmType) Less(i, j int) bool

func (AlarmType) Swap

func (a AlarmType) Swap(i, j int)

type Audit

type Audit struct {
	Idx    string `json:"idx"`
	Date   string `json:"date"`
	User   string `json:"user"`
	Option string `json:"option"`
	Object string `json:"object"`
	Addr   string `json:"address"`
	Result string `json:"result"`
}

func AuditAllGet

func AuditAllGet() ([]*Audit, error)

func AuditGet

func AuditGet(idx string) (*Audit, error)

type AuditType

type AuditType []*Audit

func (AuditType) Len

func (a AuditType) Len() int

func (AuditType) Less

func (a AuditType) Less(i, j int) bool

func (AuditType) Swap

func (a AuditType) Swap(i, j int)

type USER_LEVEL

type USER_LEVEL int
const (
	LEVEL_SAFE USER_LEVEL
	LEVEL_OPT
	LEVEL_SUPER
)

type UserInfo

type UserInfo struct {
	Name  string     `json:"name"`
	Pwd   string     `json:"password"`
	Date  string     `json:"date"`
	Level USER_LEVEL `json:"level"`
}

func UserGet

func UserGet(name string) (*UserInfo, error)

func (*UserInfo) CheckPasswod

func (this *UserInfo) CheckPasswod(pwd string) bool

Jump to

Keyboard shortcuts

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