database

package
v0.0.0-...-e07aaa2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dsn string) *gorm.DB

func InitRedis

func InitRedis(url string) *redis.Client

Types

type FnStatusCode

type FnStatusCode int
const (
	FnReady FnStatusCode = iota
	FnRunning
	FnUnknownState
)

type Function

type Function struct {
	ID             uuid.UUID `json:"id" ,gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	Language       string    `json:"language"`
	Built          bool      `json:"built"`           // The builder has built the image for this function
	BuildTimestamp int64     `json:"build_timestamp"` // The timestamp of the last build in Unix time

}

type FunctionState

type FunctionState struct {
	ID       string `redis:"id"`
	Address  string `redis:"address"`
	Port     uint16 `redis:"port"`
	Status   int    `redis:"status"`
	LastUsed string `redis:"lastUsed"`
}

This struct represents an instance of a function, especially it's address and status Each key in the redis is namespaced as it follows: <id of the function>:<id of the instance>

type User

type User struct {
	gorm.Model
	Username       string
	HashedPassword string
}

Jump to

Keyboard shortcuts

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