sql

package
v0.362.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artefact

type Artefact struct {
	ID        int64
	CreatedAt time.Time
	Digest    []byte
	Content   []byte
}

type AsyncCall

type AsyncCall struct {
	ID                int64
	CreatedAt         time.Time
	LeaseID           optional.Option[int64]
	Verb              schema.RefKey
	State             AsyncCallState
	Origin            string
	ScheduledAt       time.Time
	Request           encryption.EncryptedAsyncColumn
	Response          encryption.OptionalEncryptedAsyncColumn
	Error             optional.Option[string]
	RemainingAttempts int32
	Backoff           sqltypes.Duration
	MaxBackoff        sqltypes.Duration
	CatchVerb         optional.Option[schema.RefKey]
	Catching          bool
	ParentRequestKey  optional.Option[string]
	TraceContext      pqtype.NullRawMessage
}

type AsyncCallState

type AsyncCallState string
const (
	AsyncCallStatePending   AsyncCallState = "pending"
	AsyncCallStateExecuting AsyncCallState = "executing"
	AsyncCallStateSuccess   AsyncCallState = "success"
	AsyncCallStateError     AsyncCallState = "error"
)

func (*AsyncCallState) Scan

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

type Controller

type Controller struct {
	ID       int64
	Key      model.ControllerKey
	Created  time.Time
	LastSeen time.Time
	State    ControllerState
	Endpoint string
}

type ControllerState

type ControllerState string
const (
	ControllerStateLive ControllerState = "live"
	ControllerStateDead ControllerState = "dead"
)

func (*ControllerState) Scan

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

type CronJob

type CronJob struct {
	ID              int64
	Key             model.CronJobKey
	DeploymentID    int64
	Verb            string
	Schedule        string
	StartTime       time.Time
	NextExecution   time.Time
	ModuleName      string
	LastExecution   optional.Option[time.Time]
	LastAsyncCallID optional.Option[int64]
}

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 Deployment

type Deployment struct {
	ID          int64
	CreatedAt   time.Time
	ModuleID    int64
	Key         model.DeploymentKey
	Schema      *schema.Module
	Labels      json.RawMessage
	MinReplicas int32
}

type DeploymentArtefact

type DeploymentArtefact struct {
	ArtefactID   int64
	DeploymentID int64
	CreatedAt    time.Time
	Executable   bool
	Path         string
}

type EncryptionKey

type EncryptionKey struct {
	ID             int64
	Key            []byte
	CreatedAt      time.Time
	VerifyTimeline encryption.OptionalEncryptedTimelineColumn
	VerifyAsync    encryption.OptionalEncryptedAsyncColumn
}

type EventType

type EventType string
const (
	EventTypeCall              EventType = "call"
	EventTypeLog               EventType = "log"
	EventTypeDeploymentCreated EventType = "deployment_created"
	EventTypeDeploymentUpdated EventType = "deployment_updated"
)

func (*EventType) Scan

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

type FsmInstance

type FsmInstance struct {
	ID               int64
	CreatedAt        time.Time
	Fsm              schema.RefKey
	Key              string
	Status           FsmStatus
	CurrentState     optional.Option[schema.RefKey]
	DestinationState optional.Option[schema.RefKey]
	AsyncCallID      optional.Option[int64]
	UpdatedAt        time.Time
}

type FsmNextEvent

type FsmNextEvent struct {
	ID            int64
	CreatedAt     time.Time
	FsmInstanceID int64
	NextState     schema.RefKey
	Request       encryption.EncryptedAsyncColumn
	RequestType   sqltypes.Type
}

type FsmStatus

type FsmStatus string
const (
	FsmStatusRunning   FsmStatus = "running"
	FsmStatusCompleted FsmStatus = "completed"
	FsmStatusFailed    FsmStatus = "failed"
)

func (*FsmStatus) Scan

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

type GetOnlyEncryptionKeyRow

type GetOnlyEncryptionKeyRow struct {
	Key            []byte
	VerifyTimeline encryption.OptionalEncryptedTimelineColumn
	VerifyAsync    encryption.OptionalEncryptedAsyncColumn
}

type IngressRoute

type IngressRoute struct {
	Method       string
	Path         string
	DeploymentID int64
	Module       string
	Verb         string
}

type Lease

type Lease struct {
	ID             int64
	IdempotencyKey uuid.UUID
	Key            leases.Key
	CreatedAt      time.Time
	ExpiresAt      time.Time
	Metadata       pqtype.NullRawMessage
}

type Module

type Module struct {
	ID       int64
	Language string
	Name     string
}

type ModuleConfiguration

type ModuleConfiguration struct {
	ID        int64
	CreatedAt time.Time
	Module    optional.Option[string]
	Name      string
	Value     json.RawMessage
}

type ModuleSecret

type ModuleSecret struct {
	ID        int64
	CreatedAt time.Time
	Module    optional.Option[string]
	Name      string
	Url       string
}

type NullAsyncCallState

type NullAsyncCallState struct {
	AsyncCallState AsyncCallState
	Valid          bool // Valid is true if AsyncCallState is not NULL
}

func (*NullAsyncCallState) Scan

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

Scan implements the Scanner interface.

func (NullAsyncCallState) Value

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

Value implements the driver Valuer interface.

type NullControllerState

type NullControllerState struct {
	ControllerState ControllerState
	Valid           bool // Valid is true if ControllerState is not NULL
}

func (*NullControllerState) Scan

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

Scan implements the Scanner interface.

func (NullControllerState) Value

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

Value implements the driver Valuer interface.

type NullEventType

type NullEventType struct {
	EventType EventType
	Valid     bool // Valid is true if EventType is not NULL
}

func (*NullEventType) Scan

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

Scan implements the Scanner interface.

func (NullEventType) Value

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

Value implements the driver Valuer interface.

type NullFsmStatus

type NullFsmStatus struct {
	FsmStatus FsmStatus
	Valid     bool // Valid is true if FsmStatus is not NULL
}

func (*NullFsmStatus) Scan

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

Scan implements the Scanner interface.

func (NullFsmStatus) Value

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

Value implements the driver Valuer interface.

type NullOrigin

type NullOrigin struct {
	Origin Origin
	Valid  bool // Valid is true if Origin is not NULL
}

func (*NullOrigin) Scan

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

Scan implements the Scanner interface.

func (NullOrigin) Value

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

Value implements the driver Valuer interface.

type NullRunnerState

type NullRunnerState struct {
	RunnerState RunnerState
	Valid       bool // Valid is true if RunnerState is not NULL
}

func (*NullRunnerState) Scan

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

Scan implements the Scanner interface.

func (NullRunnerState) Value

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

Value implements the driver Valuer interface.

type NullTopicSubscriptionState

type NullTopicSubscriptionState struct {
	TopicSubscriptionState TopicSubscriptionState
	Valid                  bool // Valid is true if TopicSubscriptionState is not NULL
}

func (*NullTopicSubscriptionState) Scan

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

Scan implements the Scanner interface.

func (NullTopicSubscriptionState) Value

Value implements the driver Valuer interface.

type Origin

type Origin string
const (
	OriginIngress Origin = "ingress"
	OriginCron    Origin = "cron"
	OriginPubsub  Origin = "pubsub"
)

func (*Origin) Scan

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

type Querier

type Querier interface {
	CreateOnlyEncryptionKey(ctx context.Context, key []byte) error
	GetOnlyEncryptionKey(ctx context.Context) (GetOnlyEncryptionKeyRow, error)
	UpdateEncryptionVerification(ctx context.Context, verifyTimeline encryption.OptionalEncryptedTimelineColumn, verifyAsync encryption.OptionalEncryptedAsyncColumn) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateOnlyEncryptionKey

func (q *Queries) CreateOnlyEncryptionKey(ctx context.Context, key []byte) error

func (*Queries) GetOnlyEncryptionKey

func (q *Queries) GetOnlyEncryptionKey(ctx context.Context) (GetOnlyEncryptionKeyRow, error)

func (*Queries) UpdateEncryptionVerification

func (q *Queries) UpdateEncryptionVerification(ctx context.Context, verifyTimeline encryption.OptionalEncryptedTimelineColumn, verifyAsync encryption.OptionalEncryptedAsyncColumn) error

func (*Queries) WithTx

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

type Request

type Request struct {
	ID         int64
	Origin     Origin
	Key        model.RequestKey
	SourceAddr string
}

type Runner

type Runner struct {
	ID           int64
	Key          model.RunnerKey
	Created      time.Time
	LastSeen     time.Time
	State        RunnerState
	Endpoint     string
	ModuleName   optional.Option[string]
	DeploymentID int64
	Labels       json.RawMessage
}

type RunnerState

type RunnerState string
const (
	RunnerStateNew      RunnerState = "new"
	RunnerStateReserved RunnerState = "reserved"
	RunnerStateAssigned RunnerState = "assigned"
	RunnerStateDead     RunnerState = "dead"
)

func (*RunnerState) Scan

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

type Timeline

type Timeline struct {
	ID              int64
	TimeStamp       time.Time
	DeploymentID    int64
	RequestID       optional.Option[int64]
	Type            EventType
	CustomKey1      optional.Option[string]
	CustomKey2      optional.Option[string]
	CustomKey3      optional.Option[string]
	CustomKey4      optional.Option[string]
	Payload         encryption.EncryptedTimelineColumn
	ParentRequestID optional.Option[string]
}

type Topic

type Topic struct {
	ID        int64
	Key       model.TopicKey
	CreatedAt time.Time
	ModuleID  int64
	Name      string
	Type      string
	Head      optional.Option[int64]
}

type TopicEvent

type TopicEvent struct {
	ID           int64
	CreatedAt    time.Time
	Key          model.TopicEventKey
	TopicID      int64
	Payload      encryption.EncryptedAsyncColumn
	Caller       optional.Option[string]
	RequestKey   optional.Option[string]
	TraceContext pqtype.NullRawMessage
}

type TopicSubscriber

type TopicSubscriber struct {
	ID                   int64
	Key                  model.SubscriberKey
	CreatedAt            time.Time
	TopicSubscriptionsID int64
	DeploymentID         int64
	Sink                 schema.RefKey
	RetryAttempts        int32
	Backoff              sqltypes.Duration
	MaxBackoff           sqltypes.Duration
	CatchVerb            optional.Option[schema.RefKey]
}

type TopicSubscription

type TopicSubscription struct {
	ID           int64
	Key          model.SubscriptionKey
	CreatedAt    time.Time
	TopicID      int64
	ModuleID     int64
	DeploymentID int64
	Name         string
	Cursor       optional.Option[int64]
	State        TopicSubscriptionState
}

type TopicSubscriptionState

type TopicSubscriptionState string
const (
	TopicSubscriptionStateIdle      TopicSubscriptionState = "idle"
	TopicSubscriptionStateExecuting TopicSubscriptionState = "executing"
)

func (*TopicSubscriptionState) Scan

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

Jump to

Keyboard shortcuts

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