tag

package
v0.0.0-...-bcfd2cf Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(r *postgres.Pg, c *cache.Cache) *service

NewService instantiates a new Service layer for customer

func Routes

func Routes(g *echo.Group, s Service)

Routes mounts all /tags based routes on the main group

Types

type Model

type Model struct {
	gorm.Model
	ID       uuid.UUID `json:"id" gorm:"primarykey;index;unique"`
	Address  string    `json:"address" validate:"required,btc_addr|btc_addr_bech32" gorm:"size:64;index;not null"`
	Message  string    `json:"message" validate:"required" gorm:"not null"`
	Nickname string    `json:"nickname,omitempty" validate:"" gorm:"index;not null"`
	Type     string    `json:"type,omitempty" validate:"" gorm:"index;not null"`
	Link     string    `json:"link,omitempty" validate:""`
	Verified bool      `json:"verified,omitempty" validate:"" gorm:"default:false"`

} //@name Tag

Model of tag struct with validation

func (Model) TableName

func (m Model) TableName() string

TableName defines default table name

type Service

type Service interface {
	GetTags(output bool) (tags []Model, err error)
	CreateTag(t *Model) (err error)
	GetTag(address string, output bool) (tags []Model, err error)
	GetTaggedCluster(address string) (clusters []TaggedCluster, err error)
	GetTaggedClusterSet(address string) (clusters []Model, err error)
}

Service interface exports available methods for block service

type TaggedCluster

type TaggedCluster struct {
	Model
	Cluster uint64 `json:"cluster" validate:"" gorm:"not null"`
}

Jump to

Keyboard shortcuts

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