database

package
v0.0.0-...-4c42442 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 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 Database

type Database struct {
	// contains filtered or unexported fields
}

func New

func New(name string) (*Database, error)

func (*Database) CreateRoute

func (d *Database) CreateRoute(path string, functionId uuid.UUID) (*Route, error)

func (*Database) GetFunction

func (d *Database) GetFunction(id uuid.UUID) (*Function, error)

func (*Database) GetFunctions

func (d *Database) GetFunctions() ([]*Function, error)

func (*Database) GetRoute

func (d *Database) GetRoute(id uuid.UUID) (*Route, error)

func (*Database) GetRouteByPath

func (d *Database) GetRouteByPath(path string) (*Route, error)

func (*Database) GetRoutes

func (d *Database) GetRoutes() ([]*Route, error)

func (*Database) SaveFunction

func (d *Database) SaveFunction(f *Function) (*Function, error)

func (*Database) SaveRoute

func (d *Database) SaveRoute(f *Route) (*Route, error)

type Function

type Function struct {
	Id          string              `json:"id"`
	Image       string              `json:"image"`
	Environment FunctionEnvironment `json:"environment"`
}

type FunctionEnvironment

type FunctionEnvironment map[string]string

func ParseEnvironment

func ParseEnvironment(raw string) (FunctionEnvironment, error)

func (FunctionEnvironment) String

func (env FunctionEnvironment) String() string

type Route

type Route struct {
	Id       string    `json:"id"`
	Path     string    `json:"path"`
	Function *Function `json:"function"`
}

type Scannable

type Scannable interface {
	Scan(dest ...interface{}) error
}

Jump to

Keyboard shortcuts

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