internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 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 Analysis

type Analysis struct {
	ID           int64
	TenantID     int64
	Description  *string
	State        NullAnalysisState
	Source       netip.Addr
	ActiveWindow pgtype.Range[pgtype.Timestamptz]
}

type AnalysisState

type AnalysisState string
const (
	AnalysisStatePending  AnalysisState = "pending"
	AnalysisStateComplete AnalysisState = "complete"
)

func (*AnalysisState) Scan

func (e *AnalysisState) Scan(src interface{}) error

type CopyUsersParams

type CopyUsersParams struct {
	ID       int64
	TenantID int64
	Name     string
}

type CreateUserParams

type CreateUserParams struct {
	ID       int64
	TenantID int64
	Name     string
}

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
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type GetAnalysisParams

type GetAnalysisParams struct {
	TenantID int64
	ID       int64
}

type GetUserParams

type GetUserParams struct {
	TenantID int64
	ID       int64
}

type NullAnalysisState

type NullAnalysisState struct {
	AnalysisState AnalysisState
	Valid         bool // Valid is true if AnalysisState is not NULL
}

func (*NullAnalysisState) Scan

func (ns *NullAnalysisState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAnalysisState) Value

func (ns NullAnalysisState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	// kind: write
	CopyUsers(ctx context.Context, arg []*CopyUsersParams) (int64, error)
	// kind: write
	// shard: tenant(tenant_id)
	CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error)
	// kind: read
	// shard: tenant(tenant_id)
	GetAnalysis(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error)
	// kind: read
	// shard: tenant(tenant_id)
	GetUser(ctx context.Context, arg *GetUserParams) (*User, error)
	// kind: read
	ListUsers(ctx context.Context) ([]*User, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CopyUsers

func (q *Queries) CopyUsers(ctx context.Context, arg []*CopyUsersParams) (int64, error)

kind: write

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error)

kind: write shard: tenant(tenant_id)

func (*Queries) GetAnalysis

func (q *Queries) GetAnalysis(ctx context.Context, arg *GetAnalysisParams) (*Analysis, error)

kind: read shard: tenant(tenant_id)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, arg *GetUserParams) (*User, error)

kind: read shard: tenant(tenant_id)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]*User, error)

kind: read

func (*Queries) WithTx

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

type User

type User struct {
	ID       int64
	TenantID int64
	Name     string
}

Jump to

Keyboard shortcuts

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