handler

package
v0.0.0-...-10f32d8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUploadSize = 1024 * 1024 * 1024 // 1GB

Variables

This section is empty.

Functions

func ActionSuccess

func ActionSuccess(a *server.App) string

ActionSuccess returns the success HTML fragment

func AdminManagerRoute

func AdminManagerRoute(c echo.Context, a *server.App) error

AdminManagerRoute is the route of the manager page

func AdminRoute

func AdminRoute(c echo.Context, a *server.App) error

AdminRoute is the route for the admin panel

func CompareGordonToken

func CompareGordonToken(c echo.Context, a *server.App) error

compareGordonToken compares the token from the URL query parameter with the one from the config.yml

func ContainerManagerComponent

func ContainerManagerComponent(c echo.Context, a *server.App) error

ContainerManagerComponent handles the /container-manager route

func ContainerManagerDelete

func ContainerManagerDelete(c echo.Context, a *server.App) error

ContainerManagerDelete handles the /container-manager/delete route

func ContainerManagerEditGET

func ContainerManagerEditGET(c echo.Context, a *server.App) error

ContainerManagerEditGET displays the edit container view

func ContainerManagerEditPOST

func ContainerManagerEditPOST(c echo.Context, a *server.App) error

ContainerManagerEditPOST handles the edit container form submission

func ContainerManagerStart

func ContainerManagerStart(c echo.Context, a *server.App) error

ContainerManagerStart handles the /container-manager/start route

func ContainerManagerStop

func ContainerManagerStop(c echo.Context, a *server.App) error

ContainerManagerStop handles the /container-manager/stop route

func CreateContainerGET

func CreateContainerGET(c echo.Context, a *server.App) error

CreateContainerRoute is the route for creating a new container

func CreateContainerPOST

func CreateContainerPOST(c echo.Context, a *server.App) error

CreateContainerPOST handles the create container form submission

func FromShortIDToImageID

func FromShortIDToImageID(ShortID string) (string, error)

FromShortIDToImageID converts a short image ID to a full image ID

func GetInfos

func GetInfos(c echo.Context, a *server.App) error

Handle GET on /api/ping endpoint

func GetLocalizedData

func GetLocalizedData(c echo.Context, a *server.App) (map[string]interface{}, error)

GetLocalizedData returns the data for the localization

func ImageManagerComponent

func ImageManagerComponent(c echo.Context, a *server.App) error

ImageManagerComponent handles the /image-manager route (HTMX route)

func ImageManagerDelete

func ImageManagerDelete(c echo.Context, a *server.App) error

ImageManagerDelete handles the /image-manager/delete route

func IsAccountIDInDB

func IsAccountIDInDB(a *server.App, accountID string) (bool, error)

func IsSessionExpiredInDB

func IsSessionExpiredInDB(a *server.App, accountID string, sessionID string) (bool, error)

func Logout

func Logout(c echo.Context, a *server.App) error

func OAuthCallback

func OAuthCallback(c echo.Context, a *server.App) error

OAuthCallback handles the callback response from Github OAuth

func PostDeploy

func PostDeploy(c echo.Context, a *server.App) error

func RenderLoginPage

func RenderLoginPage(c echo.Context, a *server.App) error

RenderLoginPage renders the login.html template

func StartOAuthGithub

func StartOAuthGithub(c echo.Context, a *server.App) error

StartOAuthGithub starts the Github OAuth flow.

func StaticRoute

func StaticRoute(c echo.Context, a *server.App) error

StaticRoute serves static files from the embedded filesystem

func UploadImageGETHandler

func UploadImageGETHandler(c echo.Context, a *server.App) error

UploadImageHandler handles the /upload-image route to show the form

func UploadImagePOSTHandler

func UploadImagePOSTHandler(c echo.Context, a *server.App) error

UploadImageHandler handles the /upload-image

func ValidateSessionAndUser

func ValidateSessionAndUser(c echo.Context, a *server.App) error

Types

type HumanReadableContainer

type HumanReadableContainer struct {
	*types.Container
	Name       string
	Ports      []string
	ShortID    string
	CreatedStr string
	SizeStr    string
	UpSince    string
	StateColor string
}

type HumanReadableContainerImage

type HumanReadableContainerImage struct {
	*types.ImageSummary
	Name       string
	ShortID    string
	CreatedStr string
	SizeStr    string
}

type InfoResponse

type InfoResponse struct {
	Uptime  string `json:"uptime"`
	Version string `json:"version"`
}

func (*InfoResponse) Populate

func (info *InfoResponse) Populate(a *server.App)

type MapOperation

type MapOperation string
const (
	Fetch  MapOperation = "Fetch"
	Update MapOperation = "Update"
	Delete MapOperation = "Delete"
)

type NoDirFile

type NoDirFile struct {
	http.File
}

NoDirFile restricts directory listing

func (NoDirFile) Readdir

func (f NoDirFile) Readdir(count int) ([]fs.FileInfo, error)

type NoDirFileSys

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

NoDirFileSys restricts directory listing

func (NoDirFileSys) Open

func (nfs NoDirFileSys) Open(name string) (http.File, error)

type RollbackStep

type RollbackStep func() error

func RemoveNewContainerRollback

func RemoveNewContainerRollback(tq *TransactionQueue) RollbackStep

RemoveNewContainerRollback removes the new container if the transaction fails

func RenameNewContainerRollback

func RenameNewContainerRollback(tq *TransactionQueue) RollbackStep

RenameNewContainerRollback renames the new container back to the temporary name if it fails

func StartOldContainerRollback

func StartOldContainerRollback(tq *TransactionQueue) RollbackStep

StartOldContainerRollback starts the old container if the transaction fails

func StopNewContainerRollback

func StopNewContainerRollback(tq *TransactionQueue) RollbackStep

StopNewContainerRollback stops the new container if the transaction fails

type Sessions

type Sessions struct {
	*db.Sessions
}

type TransactionQueue

type TransactionQueue struct {
	NewContainerID    string
	NewContainerName  string
	TempContainerName string
	OldContainerID    string
	OldContainerName  string
	// contains filtered or unexported fields
}

func (*TransactionQueue) Add

func (tq *TransactionQueue) Add(step TransactionStep, rollback RollbackStep)

func (*TransactionQueue) Execute

func (tq *TransactionQueue) Execute() error

type TransactionStep

type TransactionStep func() error

func CreateNewContainerStep

func CreateNewContainerStep(tq *TransactionQueue, cmdParams docker.ContainerCommandParams) TransactionStep

CreateNewContainerStep creates a new container with the given parameters

func RemoveOldContainerStep

func RemoveOldContainerStep(tq *TransactionQueue) TransactionStep

RemoveOldContainerStep removes the old container

func RenameNewContainerStep

func RenameNewContainerStep(tq *TransactionQueue) TransactionStep

RenameNewContainerStep renames the new temporary container to the original name

func StartNewContainerStep

func StartNewContainerStep(tq *TransactionQueue) TransactionStep

StartNewContainerStep starts the new container

func StopOldContainerStep

func StopOldContainerStep(tq *TransactionQueue) TransactionStep

StopOldContainerStep stops the old container

Jump to

Keyboard shortcuts

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