storage

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSONFILE ...
	JSONFILE = "json"
	// DB ...
	DB = "db"
)

Variables

This section is empty.

Functions

func PostgreSQLConnection

func PostgreSQLConnection(ctx context.Context) (*sqlx.DB, error)

PostgreSQLConnection func for connection to PostgreSQL database.

func WalletsFromJsonToMAP added in v0.3.0

func WalletsFromJsonToMAP(ctx context.Context, path, filename string) ([]map[string]interface{}, error)

WalletsFromJsonToMAP read json filename and path

Types

type NotifierService added in v0.3.0

type NotifierService struct {
	Name   string `json:"name"`
	UserID string `json:"user_id"`
}

NotifierService ...

type OptionsSource added in v0.3.0

type OptionsSource struct {
	FileName string
	PathName string
	Pgx      *sqlx.DB
}

type Source added in v0.3.0

type Source struct {
	SourceType string
	Options    OptionsSource
}

func NewSource added in v0.3.0

func NewSource(sourceType string, options OptionsSource) Source

func (*Source) Wallets added in v0.3.0

func (s *Source) Wallets(ctx context.Context) (wallets []Wallet, err error)

func (*Source) WalletsTONotify added in v0.3.0

func (s *Source) WalletsTONotify(ctx context.Context) (wallets []Wallet, err error)

type Sourcer added in v0.3.0

type Sourcer interface {
	Wallets(ctx context.Context) (wallets []Wallet, err error)
	WalletsTONotify(ctx context.Context) (wallets []Wallet, err error)
}

Sourcer ...

type Wallet added in v0.3.0

type Wallet struct {
	Address         string            `json:"address,omitempty"`
	Symbol          string            `json:"symbol,omitempty"`
	IsActive        bool              `json:"is_active,omitempty"`
	NotifierService []NotifierService `json:"notifier_service,omitempty"`
	NetworkType     string            `json:"network_type,omitempty"`
}

Wallet ...

func WalletFromPostgreSQL added in v0.3.2

func WalletFromPostgreSQL(ctx context.Context, pgx *sqlx.DB) ([]Wallet, error)

func WalletsFromJsonToStruct added in v0.3.0

func WalletsFromJsonToStruct(ctx context.Context, path, filename string) ([]Wallet, error)

WalletsFromJsonToStruct read json filename and path

func (*Wallet) ToJSON added in v0.3.2

func (w *Wallet) ToJSON() string

Jump to

Keyboard shortcuts

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