scheme

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 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(r 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)

Types

type Build

type Build struct {
	BuildID   string `gorm:"primaryKey"`
	Data      []byte
	CreatedAt time.Time
}

type Connection

type Connection struct {
	ConnectionID  string `gorm:"primaryKey"`
	IntegrationID string
	// TODO(ENG-111): Integration Integration `gorm:"foreignKey:IntegrationID"`
	// TODO(ENG-111): Also call "Preload()" where relevant
	IntegrationToken string
	ProjectID        string
	Name             string
}

type Deployment

type Deployment struct {
	DeploymentID string `gorm:"primaryKey"`
	EnvID        string `gorm:"foreignKey"`
	BuildID      string `gorm:"foreignKey"`
	State        int32
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    gorm.DeletedAt `gorm:"index"`

	// just for foreign key constraint. Without it gorm won't enforce it
	Env   Env
	Build Build
}

func (*Deployment) AfterDelete

func (d *Deployment) AfterDelete(db *gorm.DB) error

gorm don't cascade soft deletes. hook is transactional.

type DeploymentWithStats

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

type Env

type Env struct {
	EnvID     string `gorm:"primaryKey"`
	ProjectID string `gorm:"index"`
	Name      string

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

type EnvVar

type EnvVar struct {
	EnvID string `gorm:"index"`
	Name  string
	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"`
}

type Event

type Event struct {
	EventID          string `gorm:"uniqueIndex"`
	IntegrationID    string `gorm:"index"`
	IntegrationToken string `gorm:"index"`
	OriginalEventID  string
	EventType        string `gorm:"index:idx_connection_id_event_type_seq,priority:2;index:idx_event_type"`
	ConnectionID     string `gorm:"index:idx_connection_id_event_type_seq,priority:1"`
	Data             datatypes.JSON
	Memo             datatypes.JSON
	CreatedAt        time.Time
	Seq              uint64 `gorm:"primaryKey;autoIncrement:true,index:idx_connection_id_event_type_seq,priority:3"`
}

type EventRecord

type EventRecord struct {
	Seq     uint32 `gorm:"primaryKey"`
	EventID string `gorm:"primaryKey"`
	// Event     Event
	State     int32 `gorm:"index"`
	CreatedAt time.Time
}

type Integration

type Integration struct {
	// Unique internal identifier.
	IntegrationID string `gorm:"primaryKey"`

	// 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 string `gorm:"primaryKey"`
	Name      string `gorm:"uniqueIndex"`
	RootURL   string
	Resources []byte
}

type Session

type Session struct {
	SessionID        string `gorm:"primaryKey"`
	DeploymentID     string `gorm:"index;foreignKey"`
	EventID          string `gorm:"index"`
	CurrentStateType int    `gorm:"index"`
	Entrypoint       string
	Inputs           datatypes.JSON
	CreatedAt        time.Time      //`gorm:"default:current_timestamp"`
	UpdatedAt        time.Time      //`gorm:"default:current_timestamp"`
	DeletedAt        gorm.DeletedAt `gorm:"index"`

	// just for foreign key constraint. Without it gorm won't enforce it
	Deployment *Deployment
}

type SessionCallAttempt

type SessionCallAttempt struct {
	SessionID string `gorm:"uniqueIndex:idx_session_id_seq_attempt,priority:1"`
	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
}

type SessionCallSpec

type SessionCallSpec struct {
	SessionID string `gorm:"primaryKey"`
	Seq       uint32 `gorm:"primaryKey"`
	Data      datatypes.JSON
}

type SessionLogRecord

type SessionLogRecord struct {
	SessionID string `gorm:"index"`
	Data      datatypes.JSON
}

type Signal

type Signal struct {
	SignalID     string `gorm:"primaryKey"`
	ConnectionID string `gorm:"index:idx_connection_id_event_type"`
	Connection   Connection
	CreatedAt    time.Time
	WorkflowID   string
	EventType    string `gorm:"index:idx_connection_id_event_type"`
}

type Trigger

type Trigger struct {
	TriggerID string `gorm:"primaryKey"`

	ProjectID    string `gorm:"index"`
	EnvID        string `gorm:"index"`
	ConnectionID string `gorm:"index"`
	Connection   Connection
	EventType    string
	CodeLocation string
}

Jump to

Keyboard shortcuts

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