scheme

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 13 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 ParseEvent

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

func ParseEventRecord

func ParseEventRecord(e EventRecord) (sdktypes.EventRecord, 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;not null"`
	ProjectID *sdktypes.UUID `gorm:"index;type:uuid"`
	Data      []byte
	CreatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`

	// enforce foreign keys
	Project   *Project
	Ownership *Ownership `gorm:"polymorphic:Entity;"`
}

type Connection

type Connection struct {
	ConnectionID  sdktypes.UUID  `gorm:"primaryKey;type:uuid;not null"`
	IntegrationID *sdktypes.UUID `gorm:"index;type:uuid"`
	ProjectID     *sdktypes.UUID `gorm:"index;type:uuid"`
	Name          string
	StatusCode    int32 `gorm:"index"`
	StatusMessage string

	DeletedAt gorm.DeletedAt `gorm:"index"`

	// enforce foreign keys
	Project   *Project
	Ownership *Ownership `gorm:"polymorphic:Entity;"`
}

type Deployment

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

	// enforce foreign keys
	Env       *Env
	Build     *Build
	Ownership *Ownership `gorm:"polymorphic:Entity;"`
}

func (*Deployment) BeforeUpdate added in v0.9.0

func (d *Deployment) BeforeUpdate(tx *gorm.DB) (err error)

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;not null"`
	ProjectID sdktypes.UUID `gorm:"index;type:uuid;not null"`
	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
	Ownership *Ownership `gorm:"polymorphic:Entity;"`
}

type Event

type Event struct {
	EventID       sdktypes.UUID  `gorm:"uniqueIndex;type:uuid;not null"`
	DestinationID sdktypes.UUID  `gorm:"index;type:uuid;not null"`
	IntegrationID *sdktypes.UUID `gorm:"index;type:uuid"`
	ConnectionID  *sdktypes.UUID `gorm:"index;type:uuid"`
	TriggerID     *sdktypes.UUID `gorm:"index;type:uuid"`

	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"`

	// enforce foreign keys
	Connection *Connection
	Trigger    *Trigger
	Ownership  *Ownership `gorm:"polymorphic:Entity;"`
}

type EventRecord

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

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

type Ownership added in v0.8.0

type Ownership struct {
	EntityID   sdktypes.UUID `gorm:"primaryKey;type:uuid;not null"`
	EntityType string        `gorm:"not null"`

	UserID string `gorm:"not null"`
}

type Project

type Project struct {
	ProjectID sdktypes.UUID `gorm:"primaryKey;type:uuid;not null"`
	Name      string        `gorm:"index;not null"`
	RootURL   string
	Resources []byte
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Ownership *Ownership     `gorm:"polymorphic:Entity;"`
}

type Secret added in v0.3.1

type Secret struct {
	Key   string `gorm:"primaryKey"`
	Value string `gorm:"type:string"`
}

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;not null"`
	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"`
	Ownership  *Ownership `gorm:"polymorphic:Entity;"`
}

type SessionCallAttempt

type SessionCallAttempt struct {
	SessionID sdktypes.UUID `gorm:"uniqueIndex:idx_session_id_seq_attempt,priority:1;type:uuid;not null"`
	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;not null"`
	Seq       uint32        `gorm:"primaryKey"`
	Data      datatypes.JSON

	// enforce foreign keys
	Session *Session
}

type SessionLogRecord

type SessionLogRecord struct {
	SessionID sdktypes.UUID `gorm:"primaryKey:SessionID;type:uuid;not null"`
	Seq       uint64        `gorm:"primaryKey;not null"`
	Data      datatypes.JSON

	// enforce foreign keys
	Session *Session
}

type Signal

type Signal struct {
	SignalID      sdktypes.UUID  `gorm:"primaryKey;type:uuid;not null"`
	DestinationID sdktypes.UUID  `gorm:"index;type:uuid;not null"`
	ConnectionID  *sdktypes.UUID `gorm:"type:uuid"`
	TriggerID     *sdktypes.UUID `gorm:"type:uuid"`
	CreatedAt     time.Time
	WorkflowID    string
	Filter        string

	// enforce foreign key
	Connection *Connection
	Trigger    *Trigger
}

type Trigger

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

	ProjectID    sdktypes.UUID  `gorm:"index;type:uuid;not null"`
	SourceType   string         `gorm:"index"`
	ConnectionID *sdktypes.UUID `gorm:"index;type:uuid"`
	EnvID        sdktypes.UUID  `gorm:"index;type:uuid;not null"`
	Name         string
	EventType    string
	Filter       string
	CodeLocation string

	// enforce foreign keys
	Project    *Project
	Env        *Env
	Connection *Connection
	Ownership  *Ownership `gorm:"polymorphic:Entity;"`

	// Makes sure name is unique - this is the env_id with name.
	UniqueName string `gorm:"uniqueIndex;not null"`

	WebhookSlug string `gorm:"index"`
	Schedule    string
}

type Var added in v0.5.0

type Var struct {
	// varID is scopeID. just mapped directly for reusing the join code
	VarID         sdktypes.UUID `gorm:"primaryKey;index;type:uuid;not null"`
	ScopeID       sdktypes.UUID `gorm:"-"`
	Name          string        `gorm:"primaryKey;index;not null"`
	Value         string
	IsSecret      bool
	IntegrationID sdktypes.UUID `gorm:"index;type:uuid"` // var lookup by integration id
}

func (*Var) AfterFind added in v0.8.0

func (v *Var) AfterFind(tx *gorm.DB) (err error)

simple hook to populate ScopeID after retrieving a Var from the database

func (*Var) BeforeCreate added in v0.8.0

func (v *Var) BeforeCreate(tx *gorm.DB) (err error)

Jump to

Keyboard shortcuts

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