abuse

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: 12 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 /abuse based routes on the main group

Types

type AbusedCluster

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

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"`
	AbuseTypeID     string    `json:"abuse_type_id"`
	AbuseTypeOther  string    `json:"abuse_type_other"`
	Abuser          string    `gorm:"index"`
	Description     string    `json:"description"`
	FromCountry     string    `json:"from_country"`
	FromCountryCode string    `json:"from_country_code"`

} //@name Abuse

Model of abuse struct with validation

func (Model) TableName

func (m Model) TableName() string

TableName defines default table name

type Service

type Service interface {
	GetAbuses(output bool) (abuses []Model, err error)
	CreateAbuse(abuse *Model) (err error)
	GetAbuse(address string, output bool) (abuses []Model, err error)
	GetAbusedCluster(address string) (clusters []AbusedCluster, err error)
	GetAbusedClusterSet(address string) (clusters []Model, err error)
}

Service interface exports available methods for block service

Jump to

Keyboard shortcuts

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