dbsqlc

package
v0.0.0-...-033bb3c Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkInsertLogsParams

type BulkInsertLogsParams struct {
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	Log        pgtype.Text        `json:"log"`
}

type BulkInsertMetricsParams

type BulkInsertMetricsParams struct {
	CreatedAts  []pgtype.Timestamptz `json:"created_ats"`
	TenantIds   []pgtype.UUID        `json:"tenant_ids"`
	ResourceIds []pgtype.UUID        `json:"resource_ids"`
	EventTypes  []string             `json:"event_types"`
	Datas       [][]byte             `json:"datas"`
}

type BulkInsertSimpleParams

type BulkInsertSimpleParams struct {
	CreatedAts  []pgtype.Timestamptz `json:"created_ats"`
	TenantIds   []pgtype.UUID        `json:"tenant_ids"`
	ResourceIds []pgtype.UUID        `json:"resource_ids"`
	Datas       [][]byte             `json:"datas"`
}

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 GetMetricsParams

type GetMetricsParams struct {
	Interval      pgtype.Interval    `json:"interval"`
	Tenantid      pgtype.UUID        `json:"tenantid"`
	Resourceid    pgtype.UUID        `json:"resourceid"`
	Createdafter  pgtype.Timestamptz `json:"createdafter"`
	Createdbefore pgtype.Timestamptz `json:"createdbefore"`
}

type GetMetricsRow

type GetMetricsRow struct {
	Bucket         interface{} `json:"bucket"`
	SucceededCount int32       `json:"succeeded_count"`
	FailedCount    int32       `json:"failed_count"`
}

type InsertMetricsParams

type InsertMetricsParams struct {
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	EventType  MetricEventType    `json:"event_type"`
	Data       []byte             `json:"data"`
}

type InsertSimpleParams

type InsertSimpleParams struct {
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	Data       []byte             `json:"data"`
}

type ListEventsByResourceIDParams

type ListEventsByResourceIDParams struct {
	ResourceID pgtype.UUID `json:"resource_id"`
	TenantID   pgtype.UUID `json:"tenant_id"`
}

type ListLogsParams

type ListLogsParams struct {
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	CreatedAt_2 pgtype.Timestamptz `json:"created_at_2"`
	TenantID    pgtype.UUID        `json:"tenant_id"`
	ResourceID  pgtype.UUID        `json:"resource_id"`
}

type Log

type Log struct {
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	Log        pgtype.Text        `json:"log"`
}

type MetricEvent

type MetricEvent struct {
	ID         int64              `json:"id"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	EventType  MetricEventType    `json:"event_type"`
	Data       []byte             `json:"data"`
}

type MetricEventType

type MetricEventType string
const (
	MetricEventTypeSUCCEEDED MetricEventType = "SUCCEEDED"
	MetricEventTypeFAILED    MetricEventType = "FAILED"
)

func (*MetricEventType) Scan

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

type MetricEventsSummary

type MetricEventsSummary struct {
	Minute         interface{} `json:"minute"`
	TenantID       pgtype.UUID `json:"tenant_id"`
	SucceededCount int64       `json:"succeeded_count"`
	FailedCount    int64       `json:"failed_count"`
}

type NullMetricEventType

type NullMetricEventType struct {
	MetricEventType MetricEventType `json:"metric_event_type"`
	Valid           bool            `json:"valid"` // Valid is true if MetricEventType is not NULL
}

func (*NullMetricEventType) Scan

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

Scan implements the Scanner interface.

func (NullMetricEventType) Value

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

Value implements the driver Valuer interface.

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) BulkInsertLogs

func (q *Queries) BulkInsertLogs(ctx context.Context, db DBTX, arg []BulkInsertLogsParams) (int64, error)

func (*Queries) BulkInsertMetrics

func (q *Queries) BulkInsertMetrics(ctx context.Context, db DBTX, arg BulkInsertMetricsParams) ([]*MetricEvent, error)

func (*Queries) BulkInsertSimple

func (q *Queries) BulkInsertSimple(ctx context.Context, db DBTX, arg BulkInsertSimpleParams) ([]*SimpleEvent, error)

func (*Queries) GetEventByID

func (q *Queries) GetEventByID(ctx context.Context, db DBTX, id int64) (*SimpleEvent, error)

func (*Queries) GetMetrics

func (q *Queries) GetMetrics(ctx context.Context, db DBTX, arg GetMetricsParams) ([]*GetMetricsRow, error)

func (*Queries) InsertMetrics

func (q *Queries) InsertMetrics(ctx context.Context, db DBTX, arg InsertMetricsParams) (*MetricEvent, error)

func (*Queries) InsertSimple

func (q *Queries) InsertSimple(ctx context.Context, db DBTX, arg InsertSimpleParams) (*SimpleEvent, error)

func (*Queries) ListEventsByResourceID

func (q *Queries) ListEventsByResourceID(ctx context.Context, db DBTX, arg ListEventsByResourceIDParams) ([]*SimpleEvent, error)

func (*Queries) ListLogs

func (q *Queries) ListLogs(ctx context.Context, db DBTX, arg ListLogsParams) ([]*Log, error)

type SimpleEvent

type SimpleEvent struct {
	ID         int64              `json:"id"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	TenantID   pgtype.UUID        `json:"tenant_id"`
	ResourceID pgtype.UUID        `json:"resource_id"`
	Data       []byte             `json:"data"`
}

Jump to

Keyboard shortcuts

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