db

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeferRollback

func DeferRollback(txn *sql.Tx)

DeferRollback calls rollback on the given transaction and logs the potential error.

Types

type Client

type Client struct {
	*sql.DB

	MMClient *maxmind.Client

	UdgerClient *udger.Client
}

func NewClient

func NewClient(c *cli.Context) (*Client, error)

func (*Client) GetAuthorization

func (c *Client) GetAuthorization(ctx context.Context, exec boil.ContextExecutor, apiKey string) (*models.Authorization, error)

func (*Client) UpsertIPAddresses

func (c *Client) UpsertIPAddresses(ctx context.Context, exec boil.ContextExecutor, addrInfos map[string]*maxmind.AddrInfo) (models.IPAddressSlice, *string, *string, *int, error)

func (*Client) UpsertMultiAddress added in v0.6.0

func (c *Client) UpsertMultiAddress(ctx context.Context, exec boil.ContextExecutor, maddr ma.Multiaddr) (*models.MultiAddress, error)

func (*Client) UpsertMultiAddresses

func (c *Client) UpsertMultiAddresses(ctx context.Context, exec boil.ContextExecutor, maddrs []ma.Multiaddr) (models.MultiAddressSlice, error)

func (*Client) UpsertMultiAddressesSet added in v0.3.0

func (c *Client) UpsertMultiAddressesSet(ctx context.Context, exec boil.ContextExecutor, dbMaddrs models.MultiAddressSlice) (int, error)

func (*Client) UpsertPeer

func (c *Client) UpsertPeer(ctx context.Context, exec boil.ContextExecutor, pid peer.ID, agentVersion *string, protocols []string) (*models.Peer, error)

Jump to

Keyboard shortcuts

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