categories

package
Version: 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 Category

type Category 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"  `
	Parent      uuid.UUID      `json:"parent" gorm:"index:category_parent"`
	Owner       uuid.UUID      `gorm:"index:category_owner;not null" json:"owner" `
}

Category to iterate with database

func (*Category) BeforeCreate

func (c *Category) BeforeCreate(scope *gorm.DB) (err error)

BeforeCreate execute commands before creating a Category

func (Category) TableName

func (Category) TableName() string

TableName returns Category 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) (*Category, error)
	Save(ctx context.Context, row *Category) error
	Query(ctx context.Context, filters *rest.Query) ([]Category, error)
}

Repository interface defines methods to manipute user categories

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL