demo

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address added in v0.12.0

type Address struct {
	Id       int64    `sql:"pk: true, auto: true"`
	Lines    []string `sql:"encode: json"`
	Town     *string  `sql:"size: 80, index: townIdx"`
	Postcode string   `sql:"size: 20, index: postcodeIdx"`
}

type Association

type Association struct {
	Id       int64 `sql:"pk: true, auto: true"`
	Name     *string
	Quality  *QualName
	Ref1     *int64
	Ref2     *int64
	Category *Category
}

type Author

type Author struct {
	Name     string `sql:"prefixed: true"`
	Email    Email  `sql:"prefixed: true"`
	Username string `sql:"prefixed: true"`
}

type Category

type Category uint8
const (
	Alpha Category = iota
	Beta
	Gamma
	Delta
)

type Commit

type Commit struct {
	ID        string `sql:"name: commit_id"`
	Message   string
	Timestamp string
	Author    *Author
	Committer *Author
}

type Compound

type Compound struct {
	Alpha    string `sql:"unique: alpha_beta"`
	Beta     string `sql:"unique: alpha_beta"`
	Category Category
}

type Date

type Date struct {
	// contains filtered or unexported fields
}

type Dates

type Dates struct {
	After  string `sql:"size: 20"`
	Before string `sql:"size: 20"`
}

type Email

type Email string

type Hook

type Hook struct {
	Id  uint64 `sql:"pk: true, auto: true"`
	Sha string
	Dates
	Category   Category
	Created    bool
	Deleted    bool
	Forced     bool
	HeadCommit *Commit `sql:"name: head"`
}

type HookList

type HookList []*Hook

type Issue

type Issue struct {
	Id       int64 `sql:"pk: true, auto: true"`
	Number   int
	Date     Date
	Title    string   `sql:"size: 512"`
	Body     string   `sql:"size: 2048, name: bigbody"`
	Assignee string   `sql:"index: issue_assignee"`
	State    string   `sql:"size: 50"`
	Labels   []string `sql:"encode: json"`
	// contains filtered or unexported fields
}

type Numbers added in v0.19.0

type Numbers struct {
	I8  int8    `sql:"default: -8"`
	U8  uint8   `sql:"default: 8"`
	I16 int16   `sql:"default: -16"`
	U16 uint16  `sql:"default: 16"`
	I32 int32   `sql:"default: -32"`
	U32 uint32  `sql:"default: 32"`
	I64 int64   `sql:"default: -64"`
	U64 uint64  `sql:"default: 64"`
	F32 float32 `sql:"default: 3.2"`
	F64 float64 `sql:"default: 6.4"`
}

type QualName added in v0.33.0

type QualName string

type Role added in v0.10.0

type Role int8
const (
	Unknown Role = iota
	UserRole
	AdminRole
)

func (*Role) Parse added in v0.10.0

func (v *Role) Parse(s string) error

func (*Role) Scan added in v0.10.0

func (r *Role) Scan(value interface{}) error

func (Role) String added in v0.10.0

func (v Role) String() string

func (Role) Value added in v0.10.0

func (r Role) Value() (driver.Value, error)

type User

type User struct {
	Uid          int64  `sql:"pk: true, auto: true"`
	Name         string `sql:"unique: user_login"`
	EmailAddress string `sql:"nk: true"`
	AddressId    *int64 `sql:"fk: addresses.id, onupdate: restrict, ondelete: restrict"`
	Avatar       *string
	Role         *Role `sql:"type: text, size: 20"`
	Active       bool
	Admin        bool
	Fave         *big.Int `sql:"encode: json"`
	LastUpdated  int64

	// something just to aid test coverage
	Numbers Numbers
	// contains filtered or unexported fields
}

func (*User) PostGet added in v0.8.0

func (u *User) PostGet() error

func (*User) PreInsert

func (u *User) PreInsert() error

These hooks are just used here for testing, but you could put whatever you like in them.

func (*User) PreUpdate

func (u *User) PreUpdate() error

Jump to

Keyboard shortcuts

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