db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 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.

func MapNetDirection

func MapNetDirection(conn network.Conn) string

MapNetDirection maps the connection direction the corresponding database types.

Types

type Client

type Client struct {
	*sql.DB

	MMClient *maxmind.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, maddr ma.Multiaddr) (models.IPAddressSlice, *string, *string, *int, 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