sql

package
v0.296.11 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 12 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           time.Duration
	MaxBackoff        time.Duration
}

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 CreateCronJobParams

type CreateCronJobParams struct {
	Key           model.CronJobKey
	DeploymentKey model.DeploymentKey
	ModuleName    string
	Verb          string
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
}

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 {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Deployment

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

type DeploymentArtefact

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

type EndCronJobRow

type EndCronJobRow struct {
	Key           model.CronJobKey
	DeploymentKey model.DeploymentKey
	Module        string
	Verb          string
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
	State         model.CronJobState
}

type Event

type Event 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      json.RawMessage
}

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]
}

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 GetCronJobsRow

type GetCronJobsRow struct {
	Key           model.CronJobKey
	DeploymentKey model.DeploymentKey
	Module        string
	Verb          string
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
	State         model.CronJobState
}

type GetStaleCronJobsRow

type GetStaleCronJobsRow struct {
	Key           model.CronJobKey
	DeploymentKey model.DeploymentKey
	Module        string
	Verb          string
	Schedule      string
	StartTime     time.Time
	NextExecution time.Time
	State         model.CronJobState
}

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       []byte
}

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     []byte
}

type ModuleSecret added in v0.281.6

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 {
	CreateCronJob(ctx context.Context, arg CreateCronJobParams) error
	EndCronJob(ctx context.Context, nextExecution time.Time, key model.CronJobKey, startTime time.Time) (EndCronJobRow, error)
	GetCronJobs(ctx context.Context) ([]GetCronJobsRow, error)
	GetStaleCronJobs(ctx context.Context, dollar_1 time.Duration) ([]GetStaleCronJobsRow, error)
	StartCronJobs(ctx context.Context, keys []string) ([]StartCronJobsRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateCronJob

func (q *Queries) CreateCronJob(ctx context.Context, arg CreateCronJobParams) error

func (*Queries) EndCronJob

func (q *Queries) EndCronJob(ctx context.Context, nextExecution time.Time, key model.CronJobKey, startTime time.Time) (EndCronJobRow, error)

func (*Queries) GetCronJobs

func (q *Queries) GetCronJobs(ctx context.Context) ([]GetCronJobsRow, error)

func (*Queries) GetStaleCronJobs

func (q *Queries) GetStaleCronJobs(ctx context.Context, dollar_1 time.Duration) ([]GetStaleCronJobsRow, error)

func (*Queries) StartCronJobs

func (q *Queries) StartCronJobs(ctx context.Context, keys []string) ([]StartCronJobsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.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             []byte
}

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 StartCronJobsRow

type StartCronJobsRow struct {
	Key            model.CronJobKey
	DeploymentKey  model.DeploymentKey
	Module         string
	Verb           string
	Schedule       string
	StartTime      time.Time
	NextExecution  time.Time
	State          model.CronJobState
	HasMinReplicas bool
	Updated        bool
}

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
}

type TopicSubscriber

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

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