model

package
v0.0.0-...-08951a2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Activity

func Activity(user string)

func Delete

func Delete(t byte, id, user string, renew bool) error

func GetAll

func GetAll(t byte, user string) (string, error)

func GetFiles

func GetFiles() string

func Init

func Init()

func Tag

func Tag(user, tag string, ignore bool)

func Upload

func Upload(t, n, uid string, file *multipart.FileHeader) error

func Upsert

func Upsert(t, action byte, m Modeler, user string) error

func Validate

func Validate(t byte, id, user string) error

Types

type Comment

type Comment struct {
	Id     string `json:"id"`
	Author string `json:"auth"`
	Owner  string `json:"owner"`
	To     string `json:"to"`
	Type   string `json:"type"`
	Text   string `json:"text"`
}

type Good

type Good struct {
	Id     string            `json:"id"`
	Author string            `json:"auth"`
	Title  string            `json:"title"`
	Type   string            `json:"type"`
	Price  string            `json:"price"`
	Text   string            `json:"text"`
	Table  map[string]string `json:"Table"`
	Images []string          `json:"images"`
}

type MTime

type MTime struct {
	Users    string `json:"users"`
	Goods    string `json:"goods"`
	Posts    string `json:"posts"`
	Comments string `json:"cmnts"`
	Files    string `json:"files"`
}

func (*MTime) Get

func (t *MTime) Get()

type Modeler

type Modeler interface {
	// contains filtered or unexported methods
}

func GetOne

func GetOne(t byte, id string) (Modeler, error)

func Model

func Model(t byte) Modeler

type Password

type Password struct {
	Id   string `json:"id"`
	Pass string `json:"pass"`
}

func (*Password) Login

func (p *Password) Login() (*User, error)

type Post

type Post struct {
	Id     string `json:"id"`
	Author string `json:"auth"`
	Title  string `json:"title"`
	Type   string `json:"type"`
	Text   string `json:"text"`
}

type User

type User struct {
	Id       string            `json:"id"`
	Status   byte              `json:"status"`
	Title    string            `json:"title"`
	Type     string            `json:"type"`
	Table    map[string]string `json:"Table"`
	Activity int64             `json:"activity"`
	Scribes  []string          `json:"scribes"`
	Ignores  []string          `json:"ignores"`
}

type UserAction

type UserAction struct {
	IP     string
	User   string
	Action string
}

func (*UserAction) Init

func (ua *UserAction) Init(ip, user, action string) *UserAction

func (*UserAction) IsWait

func (ua *UserAction) IsWait(sec int64) (isWait bool, wait string)

Jump to

Keyboard shortcuts

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