scheme

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ParseBuild

func ParseBuild(b Build) (sdktypes.Build, error)

func ParseConnection

func ParseConnection(c Connection) (sdktypes.Connection, error)

func ParseDeployment

func ParseDeployment(d Deployment) (sdktypes.Deployment, error)

func ParseDeploymentWithSessionStats

func ParseDeploymentWithSessionStats(d DeploymentWithStats) (sdktypes.Deployment, error)

func ParseEnv

func ParseEnv(e Env) (sdktypes.Env, error)

func ParseEnvVar

func ParseEnvVar(r EnvVar) (sdktypes.EnvVar, error)

func ParseEvent

func ParseEvent(e Event) (sdktypes.Event, error)

func ParseEventRecord

func ParseEventRecord(e EventRecord) (sdktypes.EventRecord, error)

func ParseIntegration

func ParseIntegration(i Integration) (sdktypes.Integration, error)

func ParseProject

func ParseProject(r Project) (sdktypes.Project, error)

func ParseSession

func ParseSession(s Session) (sdktypes.Session, error)

func ParseSessionCallAttemptComplete

func ParseSessionCallAttemptComplete(c SessionCallAttempt) (d sdktypes.SessionCallAttemptComplete, err error)

func ParseSessionCallAttemptStart

func ParseSessionCallAttemptStart(c SessionCallAttempt) (d sdktypes.SessionCallAttemptStart, err error)

func ParseSessionCallSpec

func ParseSessionCallSpec(c SessionCallSpec) (spec sdktypes.SessionCallSpec, err error)

func ParseSessionLogRecord

func ParseSessionLogRecord(c SessionLogRecord) (spec sdktypes.SessionLogRecord, err error)

func ParseTrigger

func ParseTrigger(e Trigger) (sdktypes.Trigger, error)

func UUIDOrNil added in v0.4.6

func UUIDOrNil(uuid sdktypes.UUID) *sdktypes.UUID

Types

type Build

type Build struct {
	BuildID   sdktypes.UUID `gorm:"primaryKey;type:uuid"`
	Data      []byte
	CreatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Connection

type Connection struct {
	ConnectionID     sdktypes.UUID  `gorm:"primaryKey;type:uuid"`
	IntegrationID    *sdktypes.UUID `gorm:"type:uuid"`
	IntegrationToken string
	ProjectID        *sdktypes.UUID `gorm:"index;type:uuid"`
	Name             string

	// enforce foreign keys
	// Integration *Integration FIXME: ENG-590
	Project *Project
}

type Deployment

type Deployment struct {
	DeploymentID sdktypes.UUID  `gorm:"primaryKey;type:uuid"`
	EnvID        *sdktypes.UUID `gorm:"index;type:uuid"`
	BuildID      *sdktypes.UUID `gorm:"type:uuid"`
	State        int32
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    gorm.DeletedAt `gorm:"index"`

	// enforce foreign keys
	Env   *Env
	Build *Build
}

type DeploymentWithStats

type DeploymentWithStats struct {
	Deployment
	Created   uint32
	Running   uint32
	Error     uint32
	Completed uint32
	Stopped   uint32
}

type Env

type Env struct {
	EnvID     sdktypes.UUID  `gorm:"primaryKey;type:uuid"`
	ProjectID *sdktypes.UUID `gorm:"index;type:uuid"`
	Name      string
	DeletedAt gorm.DeletedAt `gorm:"index"`

	// {pid.uuid}/{name}. easier to detect dups.
	// See OrgMember for more.
	MembershipID string `gorm:"uniqueIndex"`

	// enforce foreign keys
	Project *Project
}

type EnvVar

type EnvVar struct {
	EnvID sdktypes.UUID `gorm:"primaryKey;index;type:uuid"`
	Name  string        `gorm:"primaryKey"`
	Value string        // not set if is_secret.

	// Set only if is_secret. will not be fetched by get, only by reveal.
	SecretValue string // TODO: encrypt?
	IsSecret    bool

	// {eid.uuid}/{name}. easier to detect dups.
	// See OrgMember for more.
	MembershipID string `gorm:"uniqueIndex"`

	// enforce foreign keys
	Env *Env
}

type Event

type Event struct {
	EventID          sdktypes.UUID  `gorm:"uniqueIndex;type:uuid"`
	IntegrationID    *sdktypes.UUID `gorm:"index"`
	IntegrationToken string         `gorm:"index"`
	EventType        string         `gorm:"index:idx_event_type_seq,priority:1;index:idx_event_type"`
	Data             datatypes.JSON
	Memo             datatypes.JSON
	CreatedAt        time.Time
	Seq              uint64 `gorm:"primaryKey;autoIncrement:true,index:idx_event_type_seq,priority:2"`

	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type EventRecord

type EventRecord struct {
	Seq       uint32        `gorm:"primaryKey"`
	EventID   sdktypes.UUID `gorm:"primaryKey;type:uuid"`
	State     int32         `gorm:"index"`
	CreatedAt time.Time

	// enforce foreign keys
	Event *Event `gorm:"references:EventID"`
}

type Integration

type Integration struct {
	// Unique internal identifier.
	IntegrationID sdktypes.UUID `gorm:"primaryKey;type:uuid"`

	// Unique external (and URL-safe) identifier.
	UniqueName string `gorm:"uniqueIndex"`

	DisplayName string
	Description string
	LogoURL     string
	UserLinks   datatypes.JSON

	// TODO(ENG-346): Connection UI specification instead of a URL.
	ConnectionURL string

	APIKey     string
	SigningKey string
}

type Project

type Project struct {
	ProjectID sdktypes.UUID `gorm:"primaryKey;type:uuid"`
	Name      string        `gorm:"uniqueIndex"`
	RootURL   string
	Resources []byte
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Secret added in v0.3.1

type Secret struct {
	Name string         `gorm:"primaryKey"`
	Data datatypes.JSON `gorm:"type:json"`
}

Secret is a database table that simply stores sensitive key-value pairs, for usage by the "db" mode of autokitteh's secrets manager. WARNING: This is not secure in any way, and not durable by default. It is intended only for temporary, local, non-production purposes.

type Session

type Session struct {
	SessionID        sdktypes.UUID  `gorm:"primaryKey;type:uuid"`
	BuildID          *sdktypes.UUID `gorm:"index;type:uuid"`
	EnvID            *sdktypes.UUID `gorm:"index;type:uuid"`
	DeploymentID     *sdktypes.UUID `gorm:"index;type:uuid"`
	EventID          *sdktypes.UUID `gorm:"index;type:uuid"`
	CurrentStateType int            `gorm:"index"`
	Entrypoint       string
	Inputs           datatypes.JSON
	CreatedAt        time.Time
	UpdatedAt        time.Time
	DeletedAt        gorm.DeletedAt `gorm:"index"`

	// enforce foreign keys
	Build      *Build
	Env        *Env
	Deployment *Deployment
	Event      *Event `gorm:"references:EventID"`
}

type SessionCallAttempt

type SessionCallAttempt struct {
	SessionID sdktypes.UUID `gorm:"uniqueIndex:idx_session_id_seq_attempt,priority:1;type:uuid"`
	Seq       uint32        `gorm:"uniqueIndex:idx_session_id_seq_attempt,priority:2"`
	Attempt   uint32        `gorm:"uniqueIndex:idx_session_id_seq_attempt,priority:3"`
	Start     datatypes.JSON
	Complete  datatypes.JSON

	// enforce foreign keys
	Session *Session
}

type SessionCallSpec

type SessionCallSpec struct {
	SessionID sdktypes.UUID `gorm:"primaryKey:SessionID;type:uuid"`
	Seq       uint32        `gorm:"primaryKey"`
	Data      datatypes.JSON

	// enforce foreign keys
	Session *Session
}

type SessionLogRecord

type SessionLogRecord struct {
	SessionID sdktypes.UUID `gorm:"index;type:uuid"`
	Data      datatypes.JSON

	// enforce foreign keys
	Session *Session
}

type Signal

type Signal struct {
	SignalID     string        `gorm:"primaryKey"`
	ConnectionID sdktypes.UUID `gorm:"index:idx_connection_id_event_type;type:uuid"`
	CreatedAt    time.Time
	WorkflowID   string
	Filter       string

	// enforce foreign key
	Connection *Connection
}

type Trigger

type Trigger struct {
	TriggerID sdktypes.UUID `gorm:"primaryKey;type:uuid"`

	ProjectID    sdktypes.UUID `gorm:"index;type:uuid"`
	ConnectionID sdktypes.UUID `gorm:"index;type:uuid"`
	EnvID        sdktypes.UUID `gorm:"index;type:uuid"`
	Name         string
	EventType    string
	Filter       string
	CodeLocation string
	Data         datatypes.JSON

	// enforce foreign keys
	Project    *Project
	Env        *Env
	Connection *Connection

	// Makes sure name is unique - this is the env_id with name.
	// If name is emptyy, will be env_id with a random string.
	UniqueName string `gorm:"uniqueIndex"`
}

Jump to

Keyboard shortcuts

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