db

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package db provides the database interface for the screener-api.

Package db provides the database interface for the screener-api.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAddressNotFound = errors.New("record not found")

ErrNoAddressNotFound is returned when an address is not found.

Functions

This section is empty.

Types

type BlacklistedAddress added in v0.4.0

type BlacklistedAddress struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`

	ID      string `gorm:"column:id;primaryKey" json:"id"`
	Type    string `gorm:"column:type"          json:"type"`
	Address string `gorm:"column:address"       json:"address"`
	Network string `gorm:"column:network"       json:"network"`
	Tag     string `gorm:"column:tag"           json:"tag"`
	Remark  string `gorm:"column:remark"        json:"remark"`
}

BlacklistedAddress is a blacklisted address.

type BlacklistedAddressDB added in v0.4.0

type BlacklistedAddressDB interface {
	BlacklistedAddressWriterDB
	BlacklistedAddressReaderDB
}

BlacklistedAddressDB is the interface for reading and writing blacklisted addresses to the database.

type BlacklistedAddressReaderDB added in v0.4.0

type BlacklistedAddressReaderDB interface {
	GetBlacklistedAddress(ctx context.Context, address string) (*BlacklistedAddress, error)
}

BlacklistedAddressReaderDB provides methods to read blacklisted addresses from the database.

type BlacklistedAddressWriterDB added in v0.4.0

type BlacklistedAddressWriterDB interface {
	PutBlacklistedAddress(ctx context.Context, body BlacklistedAddress) error
	DeleteBlacklistedAddress(ctx context.Context, id string) error
	UpdateBlacklistedAddress(ctx context.Context, id string, body BlacklistedAddress) error
}

BlacklistedAddressWriterDB provides methods to write blacklisted addresses to the database.

type DB added in v0.4.0

type DB interface {
	BlacklistedAddressDB
}

DB is the general database interface for the screener-api.

Directories

Path Synopsis
sql
Package sql provides a sql store for the screener-api.
Package sql provides a sql store for the screener-api.
base
Package base provides a base store for the screener-api.
Package base provides a base store for the screener-api.
mysql
Package mysql provides a mysql store for the screener-api.
Package mysql provides a mysql store for the screener-api.
sqlite
Package sqlite provides a sqlite store for the screener-api.
Package sqlite provides a sqlite store for the screener-api.

Jump to

Keyboard shortcuts

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