model

package
v0.0.0-...-449281a Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

func Init

func Init(x *gorm.DB)

Types

type ApiKey

type ApiKey struct {
	gorm.Model
	Project   Project
	ProjectID int64
	Value     string
	Scope     ApiScope
	Revoked   bool
}

func ApiKeyByValue

func ApiKeyByValue(value string) *ApiKey

func (*ApiKey) TableName

func (this *ApiKey) TableName() string

type ApiScope

type ApiScope int64
const (
	ApiReadKey ApiScope = iota
	ApiWriteKey
	ApiMasterKey
)

func (*ApiScope) Scan

func (this *ApiScope) Scan(value interface{}) error

func (ApiScope) Value

func (this ApiScope) Value() (driver.Value, error)

type Project

type Project struct {
	gorm.Model
	UUID    string
	ApiKeys []ApiKey
}

func ProjectByUUID

func ProjectByUUID(uuid string) *Project

func (*Project) AfterCreate

func (this *Project) AfterCreate(tx *gorm.DB) error

func (*Project) Delete

func (this *Project) Delete()

func (*Project) MasterKey

func (this *Project) MasterKey() *ApiKey

func (*Project) ReadKey

func (this *Project) ReadKey() *ApiKey

func (*Project) RepoName

func (this *Project) RepoName() string

func (*Project) WriteKey

func (this *Project) WriteKey() *ApiKey

Jump to

Keyboard shortcuts

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