sql

package
v0.348.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 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           []byte
	Response          []byte
	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 ConnI

type ConnI interface {
	DBTX
}

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
	State         model.CronJobState
	ModuleName    string
}

type CronJobState

type CronJobState string
const (
	CronJobStateIdle      CronJobState = "idle"
	CronJobStateExecuting CronJobState = "executing"
)

func (*CronJobState) Scan

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

type DB

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

func NewDB

func NewDB(conn ConnI) *DB

func (*DB) Conn

func (d *DB) Conn() ConnI

type DBI

type DBI interface {
	Querier
	Conn() ConnI
}

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
}

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       []byte
	RequestType   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 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 NullCronJobState

type NullCronJobState struct {
	CronJobState CronJobState
	Valid        bool // Valid is true if CronJobState is not NULL
}

func (*NullCronJobState) Scan

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

Scan implements the Scanner interface.

func (NullCronJobState) Value

func (ns NullCronJobState) 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 {
	GetModuleConfiguration(ctx context.Context, module optional.Option[string], name string) (json.RawMessage, error)
	GetModuleSecretURL(ctx context.Context, module optional.Option[string], name string) (string, error)
	ListModuleConfiguration(ctx context.Context) ([]ModuleConfiguration, error)
	ListModuleSecrets(ctx context.Context) ([]ModuleSecret, error)
	SetModuleConfiguration(ctx context.Context, module optional.Option[string], name string, value json.RawMessage) error
	SetModuleSecretURL(ctx context.Context, module optional.Option[string], name string, url string) error
	UnsetModuleConfiguration(ctx context.Context, module optional.Option[string], name string) error
	UnsetModuleSecret(ctx context.Context, module optional.Option[string], name string) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetModuleConfiguration

func (q *Queries) GetModuleConfiguration(ctx context.Context, module optional.Option[string], name string) (json.RawMessage, error)

func (*Queries) GetModuleSecretURL

func (q *Queries) GetModuleSecretURL(ctx context.Context, module optional.Option[string], name string) (string, error)

func (*Queries) ListModuleConfiguration

func (q *Queries) ListModuleConfiguration(ctx context.Context) ([]ModuleConfiguration, error)

func (*Queries) ListModuleSecrets

func (q *Queries) ListModuleSecrets(ctx context.Context) ([]ModuleSecret, error)

func (*Queries) SetModuleConfiguration

func (q *Queries) SetModuleConfiguration(ctx context.Context, module optional.Option[string], name string, value json.RawMessage) error

func (*Queries) SetModuleSecretURL

func (q *Queries) SetModuleSecretURL(ctx context.Context, module optional.Option[string], name string, url string) error

func (*Queries) UnsetModuleConfiguration

func (q *Queries) UnsetModuleConfiguration(ctx context.Context, module optional.Option[string], name string) error

func (*Queries) UnsetModuleSecret

func (q *Queries) UnsetModuleSecret(ctx context.Context, module optional.Option[string], name string) 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
	ReservationTimeout optional.Option[time.Time]
	State              RunnerState
	Endpoint           string
	ModuleName         optional.Option[string]
	DeploymentID       optional.Option[int64]
	Labels             json.RawMessage
}

type RunnerState

type RunnerState string
const (
	RunnerStateIdle     RunnerState = "idle"
	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         []byte
	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      []byte
	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

type Type

type Type = csql.Type

Jump to

Keyboard shortcuts

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