sqlc

package
v0.0.0-...-9e1b7c1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDeviceParams

type AddDeviceParams struct {
	Serial    string
	Username  string
	PublicKey string
	Ipv4      string
	Ipv6      string
	Healthy   bool
	Platform  string
}

type AddGatewayAccessGroupIDParams

type AddGatewayAccessGroupIDParams struct {
	GatewayName string
	GroupID     string
}

type AddGatewayParams

type AddGatewayParams struct {
	Name                     string
	Endpoint                 string
	PublicKey                string
	Ipv4                     string
	Ipv6                     string
	PasswordHash             string
	RequiresPrivilegedAccess bool
}

type AddGatewayRouteParams

type AddGatewayRouteParams struct {
	GatewayName string
	Route       string
	Family      string
}

type AddSessionAccessGroupIDParams

type AddSessionAccessGroupIDParams struct {
	SessionKey string
	GroupID    string
}

type AddSessionParams

type AddSessionParams struct {
	Key      string
	Expiry   string
	DeviceID int64
	ObjectID string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Device

type Device struct {
	ID          int64
	Username    string
	Serial      string
	Platform    string
	Healthy     bool
	LastUpdated sql.NullString
	PublicKey   string
	Ipv4        string
	Ipv6        string
	LastSeen    sql.NullString
	ExternalID  sql.NullString
}

type Gateway

type Gateway struct {
	Name                     string
	Endpoint                 string
	PublicKey                string
	Ipv4                     string
	RequiresPrivilegedAccess bool
	PasswordHash             string
	Ipv6                     string
}

type GatewayAccessGroupID

type GatewayAccessGroupID struct {
	GatewayName string
	GroupID     string
}

type GatewayRoute

type GatewayRoute struct {
	GatewayName string
	Route       string
	Family      string
}

type GetDeviceBySerialAndPlatformParams

type GetDeviceBySerialAndPlatformParams struct {
	Serial   string
	Platform string
}

type GetGatewayRoutesRow

type GetGatewayRoutesRow struct {
	Route  string
	Family string
}

type GetKolideIssuesForDeviceRow

type GetKolideIssuesForDeviceRow struct {
	ID          int64
	DeviceID    string
	CheckID     int64
	Title       string
	DetectedAt  string
	ResolvedAt  sql.NullString
	LastUpdated string
	Ignored     bool
	ID_2        int64
	Tags        string
	DisplayName string
	Description string
}

type GetKolideIssuesRow

type GetKolideIssuesRow struct {
	ID          int64
	DeviceID    string
	CheckID     int64
	Title       string
	DetectedAt  string
	ResolvedAt  sql.NullString
	LastUpdated string
	Ignored     bool
	ID_2        int64
	Tags        string
	DisplayName string
	Description string
}

type GetMostRecentDeviceSessionRow

type GetMostRecentDeviceSessionRow struct {
	Session Session
	Device  Device
}

type GetPeersRow

type GetPeersRow struct {
	Username  string
	PublicKey string
	Ipv4      string
}

type GetSessionByKeyRow

type GetSessionByKeyRow struct {
	Session Session
	Device  Device
}

type GetSessionsRow

type GetSessionsRow struct {
	Session Session
	Device  Device
}

type KolideCheck

type KolideCheck struct {
	ID          int64
	Tags        string
	DisplayName string
	Description string
}

type KolideIssue

type KolideIssue struct {
	ID          int64
	DeviceID    string
	CheckID     int64
	Title       string
	DetectedAt  string
	ResolvedAt  sql.NullString
	LastUpdated string
	Ignored     bool
}

type Querier

type Querier interface {
	AddDevice(ctx context.Context, arg AddDeviceParams) error
	AddGateway(ctx context.Context, arg AddGatewayParams) error
	AddGatewayAccessGroupID(ctx context.Context, arg AddGatewayAccessGroupIDParams) error
	AddGatewayRoute(ctx context.Context, arg AddGatewayRouteParams) error
	AddSession(ctx context.Context, arg AddSessionParams) error
	AddSessionAccessGroupID(ctx context.Context, arg AddSessionAccessGroupIDParams) error
	DeleteGatewayAccessGroupIDs(ctx context.Context, gatewayName string) error
	DeleteGatewayRoutes(ctx context.Context, gatewayName string) error
	DeleteKolideIssuesForDevice(ctx context.Context, deviceID string) error
	GetDeviceByExternalID(ctx context.Context, externalID sql.NullString) (*Device, error)
	GetDeviceByID(ctx context.Context, id int64) (*Device, error)
	GetDeviceByPublicKey(ctx context.Context, publicKey string) (*Device, error)
	GetDeviceBySerialAndPlatform(ctx context.Context, arg GetDeviceBySerialAndPlatformParams) (*Device, error)
	GetDevices(ctx context.Context) ([]*Device, error)
	GetGatewayAccessGroupIDs(ctx context.Context, gatewayName string) ([]string, error)
	GetGatewayByName(ctx context.Context, name string) (*Gateway, error)
	GetGatewayRoutes(ctx context.Context, gatewayName string) ([]*GetGatewayRoutesRow, error)
	GetGateways(ctx context.Context) ([]*Gateway, error)
	GetKolideCheck(ctx context.Context, id int64) (*KolideCheck, error)
	GetKolideChecks(ctx context.Context) ([]*KolideCheck, error)
	GetKolideIssues(ctx context.Context) ([]*GetKolideIssuesRow, error)
	GetKolideIssuesForDevice(ctx context.Context, deviceID string) ([]*GetKolideIssuesForDeviceRow, error)
	GetLastUsedIPV6(ctx context.Context) (string, error)
	GetMostRecentDeviceSession(ctx context.Context, sessionDeviceID int64) (*GetMostRecentDeviceSessionRow, error)
	GetPeers(ctx context.Context) ([]*GetPeersRow, error)
	GetSessionByKey(ctx context.Context, sessionKey string) (*GetSessionByKeyRow, error)
	GetSessionGroupIDs(ctx context.Context, sessionKey string) ([]string, error)
	GetSessions(ctx context.Context) ([]*GetSessionsRow, error)
	RemoveExpiredSessions(ctx context.Context) error
	SetKolideCheck(ctx context.Context, arg SetKolideCheckParams) error
	SetKolideIssue(ctx context.Context, arg SetKolideIssueParams) error
	TruncateKolideIssues(ctx context.Context) error
	UpdateDevice(ctx context.Context, arg UpdateDeviceParams) error
	UpdateGateway(ctx context.Context, arg UpdateGatewayParams) error
	UpdateGatewayDynamicFields(ctx context.Context, arg UpdateGatewayDynamicFieldsParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) AddDevice

func (q *Queries) AddDevice(ctx context.Context, arg AddDeviceParams) error

func (*Queries) AddGateway

func (q *Queries) AddGateway(ctx context.Context, arg AddGatewayParams) error

func (*Queries) AddGatewayAccessGroupID

func (q *Queries) AddGatewayAccessGroupID(ctx context.Context, arg AddGatewayAccessGroupIDParams) error

func (*Queries) AddGatewayRoute

func (q *Queries) AddGatewayRoute(ctx context.Context, arg AddGatewayRouteParams) error

func (*Queries) AddSession

func (q *Queries) AddSession(ctx context.Context, arg AddSessionParams) error

func (*Queries) AddSessionAccessGroupID

func (q *Queries) AddSessionAccessGroupID(ctx context.Context, arg AddSessionAccessGroupIDParams) error

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) DeleteGatewayAccessGroupIDs

func (q *Queries) DeleteGatewayAccessGroupIDs(ctx context.Context, gatewayName string) error

func (*Queries) DeleteGatewayRoutes

func (q *Queries) DeleteGatewayRoutes(ctx context.Context, gatewayName string) error

func (*Queries) DeleteKolideIssuesForDevice

func (q *Queries) DeleteKolideIssuesForDevice(ctx context.Context, deviceID string) error

func (*Queries) GetDeviceByExternalID

func (q *Queries) GetDeviceByExternalID(ctx context.Context, externalID sql.NullString) (*Device, error)

func (*Queries) GetDeviceByID

func (q *Queries) GetDeviceByID(ctx context.Context, id int64) (*Device, error)

func (*Queries) GetDeviceByPublicKey

func (q *Queries) GetDeviceByPublicKey(ctx context.Context, publicKey string) (*Device, error)

func (*Queries) GetDeviceBySerialAndPlatform

func (q *Queries) GetDeviceBySerialAndPlatform(ctx context.Context, arg GetDeviceBySerialAndPlatformParams) (*Device, error)

func (*Queries) GetDevices

func (q *Queries) GetDevices(ctx context.Context) ([]*Device, error)

func (*Queries) GetGatewayAccessGroupIDs

func (q *Queries) GetGatewayAccessGroupIDs(ctx context.Context, gatewayName string) ([]string, error)

func (*Queries) GetGatewayByName

func (q *Queries) GetGatewayByName(ctx context.Context, name string) (*Gateway, error)

func (*Queries) GetGatewayRoutes

func (q *Queries) GetGatewayRoutes(ctx context.Context, gatewayName string) ([]*GetGatewayRoutesRow, error)

func (*Queries) GetGateways

func (q *Queries) GetGateways(ctx context.Context) ([]*Gateway, error)

func (*Queries) GetKolideCheck

func (q *Queries) GetKolideCheck(ctx context.Context, id int64) (*KolideCheck, error)

func (*Queries) GetKolideChecks

func (q *Queries) GetKolideChecks(ctx context.Context) ([]*KolideCheck, error)

func (*Queries) GetKolideIssues

func (q *Queries) GetKolideIssues(ctx context.Context) ([]*GetKolideIssuesRow, error)

func (*Queries) GetKolideIssuesForDevice

func (q *Queries) GetKolideIssuesForDevice(ctx context.Context, deviceID string) ([]*GetKolideIssuesForDeviceRow, error)

func (*Queries) GetLastUsedIPV6

func (q *Queries) GetLastUsedIPV6(ctx context.Context) (string, error)

func (*Queries) GetMostRecentDeviceSession

func (q *Queries) GetMostRecentDeviceSession(ctx context.Context, sessionDeviceID int64) (*GetMostRecentDeviceSessionRow, error)

func (*Queries) GetPeers

func (q *Queries) GetPeers(ctx context.Context) ([]*GetPeersRow, error)

func (*Queries) GetSessionByKey

func (q *Queries) GetSessionByKey(ctx context.Context, sessionKey string) (*GetSessionByKeyRow, error)

func (*Queries) GetSessionGroupIDs

func (q *Queries) GetSessionGroupIDs(ctx context.Context, sessionKey string) ([]string, error)

func (*Queries) GetSessions

func (q *Queries) GetSessions(ctx context.Context) ([]*GetSessionsRow, error)

func (*Queries) RemoveExpiredSessions

func (q *Queries) RemoveExpiredSessions(ctx context.Context) error

func (*Queries) SetKolideCheck

func (q *Queries) SetKolideCheck(ctx context.Context, arg SetKolideCheckParams) error

func (*Queries) SetKolideIssue

func (q *Queries) SetKolideIssue(ctx context.Context, arg SetKolideIssueParams) error

func (*Queries) TruncateKolideIssues

func (q *Queries) TruncateKolideIssues(ctx context.Context) error

func (*Queries) UpdateDevice

func (q *Queries) UpdateDevice(ctx context.Context, arg UpdateDeviceParams) error

func (*Queries) UpdateGateway

func (q *Queries) UpdateGateway(ctx context.Context, arg UpdateGatewayParams) error

func (*Queries) UpdateGatewayDynamicFields

func (q *Queries) UpdateGatewayDynamicFields(ctx context.Context, arg UpdateGatewayDynamicFieldsParams) error

func (*Queries) WithTx

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

type Session

type Session struct {
	Key      string
	Expiry   string
	DeviceID int64
	ObjectID string
}

type SessionAccessGroupID

type SessionAccessGroupID struct {
	SessionKey string
	GroupID    string
}

type SetKolideCheckParams

type SetKolideCheckParams struct {
	ID          int64
	Tags        string
	DisplayName string
	Description string
}

type SetKolideIssueParams

type SetKolideIssueParams struct {
	ID          int64
	DeviceID    string
	CheckID     int64
	Title       string
	DetectedAt  string
	ResolvedAt  sql.NullString
	LastUpdated string
	Ignored     bool
}

type UpdateDeviceParams

type UpdateDeviceParams struct {
	ExternalID  sql.NullString
	Healthy     bool
	LastUpdated sql.NullString
	LastSeen    sql.NullString
	Serial      string
	Platform    string
}

type UpdateGatewayDynamicFieldsParams

type UpdateGatewayDynamicFieldsParams struct {
	RequiresPrivilegedAccess bool
	Name                     string
}

type UpdateGatewayParams

type UpdateGatewayParams struct {
	PublicKey                string
	Endpoint                 string
	Ipv4                     string
	Ipv6                     string
	RequiresPrivilegedAccess bool
	PasswordHash             string
	Name                     string
}

Jump to

Keyboard shortcuts

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