server

package
v0.0.0-...-52e1e13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type FindServerParams

type FindServerParams struct {
	ID     pgtype.UUID
	ApiKey pgtype.UUID
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateServer

func (q *Queries) CreateServer(ctx context.Context, id pgtype.UUID) (Server, error)

func (*Queries) FindServer

func (q *Queries) FindServer(ctx context.Context, arg FindServerParams) (Server, error)

func (*Queries) GetServer

func (q *Queries) GetServer(ctx context.Context, id pgtype.UUID) (Server, error)

func (*Queries) PingServer

func (q *Queries) PingServer(ctx context.Context, id pgtype.UUID) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Server

type Server struct {
	ID        pgtype.UUID
	IpAddress *netip.Prefix
	ApiKey    pgtype.UUID
	CreatedAt pgtype.Timestamp
	LastPing  pgtype.Timestamp
}

type ServerServer

type ServerServer struct {
	Q *Queries
}

func NewServerServer

func NewServerServer(db *pgx.Conn) *ServerServer

func (*ServerServer) GetServer

func (*ServerServer) Ping

Jump to

Keyboard shortcuts

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