types

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Runtimes = map[string]bool{
	"js": true,
	"go": true,
}

Functions

func ValidRuntime

func ValidRuntime(runtime string) bool

Types

type App

type App struct {
	ID           uuid.UUID         `json:"id"`
	Name         string            `json:"name"`
	Endpoint     string            `json:"endpoint"`
	ActiveDeploy uuid.UUID         `json:"activeDeploy"`
	Environment  map[string]string `json:"-"`
	Deploys      []Deploy          `json:"deploys"`
	CreatedAT    time.Time         `json:"createdAt"`
}

func NewApp

func NewApp(name string, env map[string]string) *App

func (App) HasActiveDeploy

func (app App) HasActiveDeploy() bool

type Deploy

type Deploy struct {
	ID         uuid.UUID `json:"id"`
	EndpointID uuid.UUID `json:"endpoint_id"`
	Hash       string    `json:"hash"`
	Blob       []byte    `json:"-"`
	CreatedAT  time.Time `json:"created_at"`
}

func NewDeploy

func NewDeploy(endpoint *Endpoint, blob []byte) *Deploy

type Endpoint

type Endpoint struct {
	ID             uuid.UUID         `json:"id"`
	Name           string            `json:"name"`
	URL            string            `json:"url"`
	Runtime        string            `json:"runtime"`
	ActiveDeployID uuid.UUID         `json:"active_deploy_id"`
	Environment    map[string]string `json:"environment"`
	DeployHistory  []*Deploy         `json:"deploy_history"`
	CreatedAT      time.Time         `json:"created_at"`
}

func NewEndpoint

func NewEndpoint(name string, runtime string, env map[string]string) *Endpoint

func (Endpoint) HasActiveDeploy

func (e Endpoint) HasActiveDeploy() bool

type RuntimeMetric

type RuntimeMetric struct {
	ID         uuid.UUID     `json:"id"`
	EndpointID uuid.UUID     `json:"endpoint_id"`
	DeployID   uuid.UUID     `json:"deploy_id"`
	RequestURL string        `json:"request_url"`
	Duration   time.Duration `json:"duration"`
	StartTime  time.Time     `json:"start_time"`
}

RuntimeMetric holds information about a single runtime execution.

Jump to

Keyboard shortcuts

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