model

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id        string          `json:"id"`
	Name      string          `json:"name" binding:"required"`
	Tier      AccountTierEnum `json:"tier"`
	TrialUsed bool            `json:"trialUsed"`
	CreatedOn time.Time       `json:"createdOn"`
	CreatedBy string          `json:"createdBy"`
}

func (*Account) GetBucketName

func (account *Account) GetBucketName() string

func (*Account) GetS3BucketName

func (account *Account) GetS3BucketName(region string) string

type AccountTierEnum added in v0.0.2

type AccountTierEnum uint
const (
	Basic AccountTierEnum = iota
	Free
	ProTrial
	Pro
	Enterprise
)

type AddressName

type AddressName struct {
	LongName  string `json:"longName"`
	ShortName string `json:"shortName"`
}

type App

type App struct {
	ID        string `json:"id" binding:"required"`
	AccountId string `json:"accountId" binding:"required"`
	Name      string `json:"name" binding:"required"`
	CreatedBy string `json:"createdBy" binding:"required"`

	Description  string    `json:"description"`
	LastActivity time.Time `json:"lastActivity"`
	LastUpdate   time.Time `json:"lastUpdate"`
}

type AppDefinition

type AppDefinition struct {
	Name        string             `yaml:"name"`
	Description string             `yaml:"description"`
	Modules     []ModuleDefinition `yaml:"modules"`
}

type CloudCredential

type CloudCredential struct {
	Id             string      `json:"id" binding:"required"`
	KeyId          string      `json:"keyId" binding:"required"`
	VendorID       CloudVendor `json:"vendorId" binding:"required"`
	RelatedAccount string      `json:"relatedAccount" binding:"required"`
	CreationTime   time.Time   `json:"creationTime" binding:"required"`
	UseCount       int         `json:"useCount" binding:"required"`
	Credential     []byte      `json:"credential" binding:"required"`
}

type CloudRegionDefinition

type CloudRegionDefinition struct {
	ID string `json:"id" binding:"required"`

	VendorID CloudVendor `json:"vendorId" binding:"required"`

	RegionID string `json:"regionId" binding:"required"`
	Type     string `json:"type" binding:"required"`

	Location *LngLatGeo `json:"location" binding:"required"`

	Framework FrameworkDefinition `json:"framework" binding:"required"`
	Storage   StorageDefinition   `json:"storage" binding:"required"`
}

type CloudVendor

type CloudVendor int
const (
	AWS CloudVendor = 1 + iota
	GCP
	LYR
)

func (CloudVendor) String

func (c CloudVendor) String() string

type CloudVendorDefinition

type CloudVendorDefinition struct {
	VendorID      CloudVendor `json:"vendorId" binding:"required"`
	Name          string      `json:"name" binding:"required"`
	ShortName     string      `json:"shortName" binding:"required"`
	ParentCompany string      `json:"parentCompany" binding:"required"`
	ImageUrl      string      `json:"imageUrl" binding:"required"`
}

type DeployedService

type DeployedService struct {
	Name    string      `json:"name" binding:"required"`
	Payload interface{} `json:"payload" binding:"required"`
}

type DeploymentEndpoint

type DeploymentEndpoint struct {
	ID string `json:"id" binding:"required"`

	CodeID   string      `json:"codeId" binding:"required"`
	Name     string      `json:"name" binding:"required"`
	Type     string      `json:"type" binding:"required"`
	VendorID CloudVendor `json:"vendorId" binding:"required"`
	RegionID string      `json:"regionId" binding:"required"`

	Endpoint string        `json:"endpoint" binding:"required"`
	Memory   string        `json:"memory" binding:"required"`
	Timeout  time.Duration `json:"duration" binding:"required"`

	Metadata string `json:"metadata"`
}

type ErrorIncident

type ErrorIncident struct {
	IncidentTime time.Time

	DeploymentID string
	Level        string
	Message      string
}

func (*ErrorIncident) New

func (e *ErrorIncident) New() error

type FrameworkDefinition

type FrameworkDefinition struct {
	Name     string `json:"name" binding:"required"`
	ImageUrl string `json:"imageUrl" binding:"required"`
}

type Function

type Function struct {
	ID          string `json:"id"`
	ModuleID    string `json:"moduleId"`
	RevisionID  string `json:"revisionId"`
	Name        string `json:"name"`
	Description string `json:"description"`

	LastActivity time.Time `json:"lastActivity"`
	LastUpdate   time.Time `json:"lastUpdate"`
}

type FunctionCode

type FunctionCode struct {
	ID              string    `json:"id"`
	FunctionID      string    `json:"functionId"`
	TargetFramework string    `json:"targetFramework"`
	CreationTime    time.Time `json:"creationTime"`
	CodeUri         string    `json:"codeUri"`
	ImageUri        string    `json:"imageUri"`

	ArtifactSizeByte int64 `json:"artifactSizeByte"`
}

type FunctionDefinition

type FunctionDefinition struct {
	Name        string `yaml:"name"`
	Entry       string `yaml:"entry"`
	Description string `yaml:"description"`
}

type GlobalRegionDefinition

type GlobalRegionDefinition struct {
	ID   string `json:"id" binding:"required"`
	Name string `json:"name" binding:"required"`

	Description string `json:"description"`

	Center *LngLatGeo `json:"center"`
	Radius int        `json:"radius"`

	RegionIDs []string `json:"regionIds"`
}

type Job

type Job struct {
	ID             string        `json:"id" binding:"required"`
	AccountId      string        `json:"accountId" binding:"required"`
	Type           string        `json:"type" binding:"required"`
	Status         JobStatusEnum `json:"status" binding:"required"`
	Subject        string        `json:"subject"`
	CreationTime   time.Time     `json:"creationTime"`
	LastUpdateTime time.Time     `json:"lastUpdateTime"`
	Payload        string        `json:"payload"`
}

type JobInfo

type JobInfo struct {
	JobId   string    `json:"jobId" binding:"required"`
	Message string    `json:"message" binding:"required"`
	Type    string    `json:"type" binding:"required"`
	Time    time.Time `json:"time"`
}

type JobStatusEnum

type JobStatusEnum uint
const (
	Submitting JobStatusEnum = iota
	Submitted
	Queued
	Running
	Completed
	Error
	Warning
	Cancelled
	Finished
	TimedOut
)

type LngLatGeo

type LngLatGeo struct {
	Longitute float64 `json:"longitude"`
	Latitude  float64 `json:"latitude"`

	Address *LocationDescription `json:"address"`
}

type LocationDescription

type LocationDescription struct {
	City          AddressName `json:"city"`
	Country       AddressName `json:"country"`
	StateProvince AddressName `json:"stateProvince"`
}

type LyridFunction

type LyridFunction struct {
	ID   string
	Name string
}

type LyridUser

type LyridUser struct {
	Id              string    `json:"id" binding:"required"`
	Name            string    `json:"name"`
	Email           string    `json:"email"`
	EmailVerified   bool      `json:"emailVerified"`
	Roles           []string  `json:"roles"`
	RelatedRoles    []string  `json:"relatedRoles`
	RelatedAccounts []string  `json:"relatedAccounts`
	BetaAccess      bool      `json:"betaAccess"`
	CurrentAccount  string    `json:"currentAccount"`
	DefaultAccount  string    `json:"defaultAccount"`
	LastUpdate      time.Time `json:"lastUpdate"`
}

type Module

type Module struct {
	ID          string   `json:"id"  binding:"required"`
	AppId       string   `json:"appId"  binding:"required"`
	Name        string   `json:"name"  binding:"required"`
	Language    string   `json:"language" binding:"required"`
	Web         string   `json:"web"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`

	CreatedBy    string    `json:"createdBy" binding:"required"`
	LastActivity time.Time `json:"lastActivity"`
	LastUpdate   time.Time `json:"lastUpdate"`
}

type ModuleBuild

type ModuleBuild struct {
	RevisionID      string    `json:"revisionId"`
	TargetFramework string    `json:"targetFramework"`
	CreationTime    time.Time `json:"creationTime"`
	Uri             string    `json:"uri"`
}

type ModuleDefinition

type ModuleDefinition struct {
	Name           string               `yaml:"name"`
	Language       string               `yaml:"language"`
	Description    string               `yaml:"description"`
	Web            string               `yaml:"web"`
	ProjectFolder  string               `yaml:"projectFolder"` // currently only used inside dotnet core project only, but technically this works on other languages
	PrebuildScript string               `yaml:"prebuildScript"`
	Functions      []FunctionDefinition `yaml:"functions"`
}

func (*ModuleDefinition) GetFileExtension

func (definition *ModuleDefinition) GetFileExtension() string

type ModuleRevision

type ModuleRevision struct {
	ID       string `json:"id"`
	ModuleID string `json:"moduleId"`
	CodeUri  string `json:"codeUri"`

	CreatedBy    string    `json:"createdBy"`
	CreationTime time.Time `json:"creationTime"`
	IsActive     bool      `json:"isActive"`

	Pipeline *StageDefinition `json:"pipeline"`
}

type Policy

type Policy struct {
	Id          string `json:"id"`
	LabelName   string `json:"labelName"`
	Description string `json:"description"`

	PolicyType string `json:"policyType"`
	ValueType  string `json:"valueType"`

	DefaultValue interface{} `json:"defaultValue"`
	CurrentValue interface{} `json:"currentValue"`

	PossibleValues []interface{} `json:"possibleValues"`
	Visibility     string        `json:"visibility"`
}

func (*Policy) GetValue

func (policy *Policy) GetValue() interface{}

func (*Policy) SetValue

func (policy *Policy) SetValue(input string)

func (*Policy) ValidateValue

func (policy *Policy) ValidateValue(value string) bool

type PolicyDefinition

type PolicyDefinition struct {
	Id        string `json:"id"`
	AccountID string `json:"accountId"`
	ModuleID  string `json:"moduleId"`

	Policies map[string]string `json:"policies"`

	CreatedOn  time.Time `json:"createdOn"`
	LastUpdate time.Time `json:"lastUpdate"`
}

type PublishedApp

type PublishedApp struct {
	ID          string    `json:"globalId"`
	Name        string    `json:"name"`
	Version     string    `json:"version"`
	Visibility  string    `json:"visibility"`
	SharedWith  []string  `json:"sharedwith"`
	Tier        string    `json:"tier"`
	ImageUrl    string    `json:"imageUrl"`
	SupportUrl  string    `json:"supportUrl"`
	TermUrl     string    `json:"termUrl"`
	TagIds      []string  `json:"tagids"`
	CreatedBy   string    `json:"createdby"`
	CreatedTime time.Time `json:"createTime"`
	LastUpdate  time.Time `json:"lastUpdate"`
}

type Query

type Query struct {
	Filters   []QueryFilter   `json:"filters"`
	Operation string          `json:boolOpt`
	Attribute *QueryAttribute `json:"attribute"`
}

type QueryAttribute

type QueryAttribute struct {
	Skip       int64           `json:"skip"`
	Take       int64           `json:"take"`
	ColumnSort []SortAttribure `json:"sort"`
}

func NewQueryAttribute

func NewQueryAttribute(skip int64, take int64, columnSort []SortAttribure) *QueryAttribute

type QueryFilter

type QueryFilter struct {
	// exp1 is the document name and
	QueryOperand1 string `json:"exp1"`

	// operator can be: >, >=, <, <=, ==, !=
	QueryOperator string `json:"opt"`

	// exp2 is the value usually the value to compare with
	QueryOperand2 interface{} `json:"exp2"`
}

type RequestPayload

type RequestPayload struct {
	Headers               http.Header       `json:"multiValueHeaders"`
	Path                  string            `json:"path"`
	RawQuery              string            `json:"rawQuery"`
	QueryStringParameters map[string]string `json:"queryStringParameters"`

	HttpMethod     string                 `json:"httpMethod"`
	RequestContext map[string]interface{} `json:"requestContext"`
	Body           []byte                 `json:"body"`

	IsBase64Encoded bool `json:"isBase64Encoded"`
}

func (*RequestPayload) ToQuery

func (request *RequestPayload) ToQuery() string

type ResponsePayload

type ResponsePayload struct {
	Headers             http.Header `json:"headers"`
	StatusCode          int         `json:"statusCode"`
	Body                string      `json:"body"`
	ExecutionDurationMs int64       `json:"executionDurationMs"`

	IsBase64Encoded bool `json:"isBase64Encoded"`
}

type SortAttribure

type SortAttribure struct {
	ColumnName string `json:"column"`
	Direction  string `json:"direction"`
}

type StageDefinition

type StageDefinition struct {
	Status string
	Stages map[string]*StageLogs
}

func NewStageDefinition

func NewStageDefinition() *StageDefinition

func (*StageDefinition) CreateStage

func (definition *StageDefinition) CreateStage(stage string)

func (*StageDefinition) GetStage

func (definition *StageDefinition) GetStage(stage string) *StageLogs

type StageLog

type StageLog struct {
	TargetPlatform string
	TargetRegion   string
	Status         string
	JobID          string
	Messages       []*StageMessage
}

func (*StageLog) AppendMessage

func (log *StageLog) AppendMessage(message *StageMessage)

func (*StageLog) SetStageStatus

func (log *StageLog) SetStageStatus(status string)

type StageLogs

type StageLogs struct {
	Logs []StageLog
}

func (*StageLogs) CreateStageLog

func (logs *StageLogs) CreateStageLog(platform string, region string)

func (*StageLogs) GetStageLog

func (logs *StageLogs) GetStageLog(platform string, region string) *StageLog

type StageMessage

type StageMessage struct {
	Time     time.Time
	Severity string
	Message  string
}

type StorageDefinition

type StorageDefinition struct {
	Name     string `json:"name" binding:"required"`
	ImageUrl string `json:"imageUrl" binding:"required"`

	Type     string `json:"type" binding:"required"`
	Endpoint string `json:"endpoint" binding:"required"`
}

type Subdomain

type Subdomain struct {
	Name string `json:"name" binding:"required"`

	AppId        string `json:"appId" binding:"required"`
	ModuleId     string `json:"moduleId" binding:"required"`
	FunctionName string `json:"functionName" binding:"required"`
	Tag          string `json:"tag"`
}

type Tag

type Tag struct {
	Id          string    `json:"id"`
	AppId       string    `json:"appId"`
	ModuleId    string    `json:"moduleId"`
	AccountId   string    `json:"accountId"`
	RevisionIds []string  `json:"revisionIds"`
	Name        string    `json:"name"`
	CreatedOn   time.Time `json:"createdOn"`
	LastUpdate  time.Time `json:"lastUpdate"`
}

type User

type User struct {
	ID string
}

type UserAccessToken

type UserAccessToken struct {
	Selected     string
	Key          string    `json:"key" binding:"required"`
	Secret       string    `json:"secret" binding:"required"`
	Token        string    `json:"token" binding:"required"`
	IsValid      bool      `json:"isValid" binding:"required"`
	CreationTime time.Time `json:"creationTime"`
	LastActivity time.Time `json:"lastActivity"`
}

Jump to

Keyboard shortcuts

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