db

package
v0.0.0-...-2351a71 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(path string) (*Client, error)

func (*Client) AddIPDetails

func (c *Client) AddIPDetails(details model.IPDetails) error

AddIPDetails takes a partially filled in IPDetails structure and either adds it to the database or updates an existing record if it exists. This process is transparent to the caller.

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetIPDetails

func (c *Client) GetIPDetails(addr string) (model.IPDetails, error)

type ErrNotFound

type ErrNotFound struct {
	// contains filtered or unexported fields
}

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

func (ErrNotFound) Unwrap

func (e ErrNotFound) Unwrap() error

type IPDetails

type IPDetails struct {
	UUID         string    `db:"id"`
	CreatedAt    time.Time `db:"created_at"`
	UpdatedAt    time.Time `db:"updated_at"`
	ResponseCode string    `db:"response_code"`
	IPAddress    string    `db:"ip_address"`
}

Jump to

Keyboard shortcuts

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