model

package
v0.0.0-...-d31aa54 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShieldQuotaBlown = errors.New("Shield Quota Suprassed")

Functions

This section is empty.

Types

type PublicIDGenerator

type PublicIDGenerator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*PublicIDGenerator) GetNewPublicID

func (pig *PublicIDGenerator) GetNewPublicID() (string, error)

type Shield

type Shield struct {
	ShieldID int64
	PublicID string
	UserID   int64

	Name string

	Title string
	Text  string
	Color string

	Secret string

	Created time.Time
	Updated time.Time
}

type ShieldMapper

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

func NewShieldMapper

func NewShieldMapper(db *sql.DB) *ShieldMapper

func (*ShieldMapper) Delete

func (sm *ShieldMapper) Delete(n *Shield) error

func (*ShieldMapper) GetFromID

func (sm *ShieldMapper) GetFromID(id int64) (*Shield, error)

func (*ShieldMapper) GetFromPublicID

func (sm *ShieldMapper) GetFromPublicID(publicID string) (*Shield, error)

func (*ShieldMapper) GetFromSecret

func (sm *ShieldMapper) GetFromSecret(secret string) (*Shield, error)

func (*ShieldMapper) GetFromUserID

func (sm *ShieldMapper) GetFromUserID(userID int64) ([]*Shield, error)

func (*ShieldMapper) GetFromUserIDAndID

func (sm *ShieldMapper) GetFromUserIDAndID(userID, id int64) (*Shield, error)

func (*ShieldMapper) New

func (sm *ShieldMapper) New(userID int64) (*Shield, error)

func (*ShieldMapper) Save

func (sm *ShieldMapper) Save(n *Shield) error

type User

type User struct {
	UserID int64
	Login  string
	Email  string
}

type UserMapper

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

func NewUserMapper

func NewUserMapper(db *sql.DB) *UserMapper

func (*UserMapper) GetDebugUser

func (um *UserMapper) GetDebugUser() *User

func (*UserMapper) Save

func (um *UserMapper) Save(u *User) error

Jump to

Keyboard shortcuts

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