accounts

package
v0.0.0-...-1f6e3fe Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UUID        uuid.UUID      `gorm:"type:uuid;primaryKey" json:"uuid" binding:"-"`
	CreatedAt   time.Time      `json:"createdAt" binding:"-"`
	UpdatedAt   time.Time      `json:"updatedAt" binding:"-"`
	DeletedAt   gorm.DeletedAt `json:"-" binding:"-"`
	Name        string         `json:"name" binding:"required"`
	Description string         `json:"description"  `
	Owner       uuid.UUID      `gorm:"index,not null" json:"-" `
}

Account to iterate with database

func (*Account) BeforeCreate

func (a *Account) BeforeCreate(scope *gorm.DB) (err error)

BeforeCreate execute commands before creating a Account

func (Account) TableName

func (Account) TableName() string

TableName returns Account table name

type Repository

type Repository interface {
	Delete(ctx context.Context, pk uuid.UUID, owner uuid.UUID) error
	Get(ctx context.Context, pk uuid.UUID, owner uuid.UUID) (*Account, error)
	Save(ctx context.Context, account *Account) error
	Query(ctx context.Context, filters *rest.Query) ([]*Account, error)
}

Repository interface defines methods to manipute user's accounts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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