models

package
v0.0.0-...-f501c68 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditUserToBson

func AuditUserToBson(idAudit primitive.ObjectID, remote interface{}, local interface{}, agent interface{}, user interface{}, auth interface{}, token interface{}, consult interface{}) bson.M

func OperationAuditToBson

func OperationAuditToBson(ope string, permission bool, no interface{}, ne interface{}, err error, context context.Context) bson.M

Types

type AuditEvent

type AuditEvent struct {
	Id         primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	User       primitive.ObjectID `json:"user" bson:"user,omitempty"`
	IpLocal    string             `json:"ipLocal" bson:"ipLocal"`
	IpRemote   string             `json:"ipRemote" bson:"ipRemote"`
	Agent      string             `json:"agent" bson:"agent"`
	Auth       bool               `json:"auth" bson:"auth"`
	Token      string             `json:"token" bson:"token"`
	Consult    bson.M             `json:"consult" bson:"consult"`
	Operations []OperationAudit   `json:"operations" bson:"operations"`
}

type HistoryEvent

type HistoryEvent struct {
	Id   primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name string             `bson:"name"`
	Date string             `bson:"date"`
	User primitive.ObjectID `bson:"user"`
	Info string             `bson:"info"`
}

type OperationAudit

type OperationAudit struct {
	Id         primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Operation  primitive.ObjectID `json:"operation" bson:"operation"`
	Permission bool               `json:"permission" bson:"permission"`
	NowStruct  bson.M             `json:"nowStruct" bson:"nowStruct"`
	NewStruct  bson.M             `json:"newStruct" bson:"newStruct"`
	Error      string             `json:"error" bson:"error"`
	Result     bool               `json:"result" bson:"result"`
	TimeB      time.Time          `json:"timeB" bson:"timeB"`
	TimeE      time.Time          `json:"timeE" bson:"timeE"`
}

type RequestOptions

type RequestOptions struct {
	Query         string                 `json:"query" url:"query" schema:"query"`
	Variables     map[string]interface{} `json:"variables" url:"variables" schema:"variables"`
	OperationName string                 `json:"operationName" url:"operationName" schema:"operationName"`
}

type Values

type Values struct {
	M map[string]interface{} `json:"m" url:"m" schema:"m"`
}

func (Values) Get

func (v Values) Get(key string) interface{}

Jump to

Keyboard shortcuts

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