srv

package
v0.0.0-...-6312fd5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionKind

type ActionKind int
const (
	ActionKindNone ActionKind = iota
	ActionKindList
	ActionKindUpdate
	ActionKindDelete
	ActionKindCustomer
	ActionKindTransparent
)

type FieldKind

type FieldKind int
const (
	FieldKindNone FieldKind = iota
	FieldKindString
	FieldKindInteger
	FieldKindFloat
	FieldKindBool
	FieldKindMap
	FieldKindArray
	FieldKindFile
)

type FieldSource

type FieldSource int
const (
	FieldSourceNone FieldSource = iota
	FieldSourceUser
	FieldSourceArray
	FieldSourceUrl
)

type Srv

type Srv struct {
	ID           int64             `json:"id" bson:"_id"`
	MName        string            `json:"m_name" bson:"m_name"`
	SName        string            `json:"s_name" bson:"s_name"`
	Desc         string            `json:"desc" bisn:"desc"`
	Addr         string            `json:"addr" bson:"addr"`
	ActionFields []*SrvActionField `json:"action_fields" bson:"action_fields"`
	Ct           time.Time         `json:"ct" bson:"ct"`
	Ut           time.Time         `json:"ut" bson:"ut"`
}

func NewSrv

func NewSrv() *Srv

func (*Srv) Add

func (srv *Srv) Add() (err error)

func (*Srv) Count

func (srv *Srv) Count() (total int, err error)

func (*Srv) Db

func (srv *Srv) Db() (db string)

func (*Srv) Delete

func (srv *Srv) Delete() (err error)

func (*Srv) Get

func (srv *Srv) Get() (srvRet *Srv, err error)

func (*Srv) GetByName

func (srv *Srv) GetByName() (srvRet *Srv, err error)

func (*Srv) GetC

func (srv *Srv) GetC() (c *mgo.Collection)

func (*Srv) List

func (srv *Srv) List(offset, limit int) (srvs []*Srv, err error)

func (*Srv) ParseFromRequest

func (srv *Srv) ParseFromRequest(r *http.Request) (err error)

func (*Srv) Regular

func (srv *Srv) Regular() (ok bool)

func (*Srv) Table

func (srv *Srv) Table() (table string)

func (*Srv) Update

func (srv *Srv) Update() (err error)

type SrvAction

type SrvAction struct {
	Path string     `json:"path" bson:"path"`
	Desc string     `json:"desc" bson:"desc"`
	Kind ActionKind `json:"kind" bson:"kind"`
}

func (*SrvAction) Regular

func (srvAction *SrvAction) Regular() (ok bool)

type SrvActionField

type SrvActionField struct {
	Action *SrvAction  `json:"action" bson:"action"`
	Fields []*SrvField `json:"fields" bson:"fields"`
}

func (*SrvActionField) Regular

func (srvActionField *SrvActionField) Regular() (ok bool)

type SrvField

type SrvField struct {
	Name     string      `json:"name" bson:"name"`
	Required bool        `json:"required" bson:"required"`
	Kind     FieldKind   `json:"kind" bson:"kind"`
	Source   FieldSource `json:"source" bson:"source"`
	Param    string      `json:"param,omitempty" bson:"param,omitempty"`
}

func (*SrvField) Regular

func (srvField *SrvField) Regular() (ok bool)

Jump to

Keyboard shortcuts

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