tags

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

Repository defines methods to manipute user entry's tags

type Tag

type Tag 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:tag_owner;not null" json:"-" `
}

Tag to iterate with database

func (*Tag) BeforeCreate

func (t *Tag) BeforeCreate(scope *gorm.DB) (err error)

BeforeCreate execute commands before creating a Tag

func (Tag) TableName

func (Tag) TableName() string

TableName returns tag table name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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