handlers

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

endpoint_deploy.go

endpoint_helpers.go

endpoint_push.go

Index

Constants

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

10G

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 CheckDeployConflict added in v0.1.15

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

func CompareGordonToken

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

ClLI : 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 CreateContainerFullGET

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

CreateContainerFullGET handles the full HTML page for creating a new container

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 DeviceCodeRequest

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

func DeviceTokenRequest

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

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

GetInfos handles GET requests 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 PostContainerRemove added in v0.1.14

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

PostContainerRemove handles the container remove request

func PostContainerStop added in v0.1.14

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

PostContainerStop handles the container stop request

func PostDeploy

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

PostDeploy handles the container deployment request

func PostDeployChunked added in v0.1.15

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

PostDeployChunked handles the chunked container deployment request

func PostPush

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

PostPush handles the image push request

func PostPushChunked added in v0.1.15

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

PostPushChunked handles chunked (large) image pushes

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

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 ChunkMetadata added in v0.1.15

type ChunkMetadata common.ChunkMetadata

type ChunkStore added in v0.1.15

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

type ConflictCheckResponse added in v0.1.15

type ConflictCheckResponse = common.ConflictCheckResponse

type DeployResponse

type DeployResponse = common.DeployResponse

type HumanReadableContainer

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

type HumanReadableContainerImage

type HumanReadableContainerImage struct {
	ID          string
	Name        string
	ShortID     string
	CreatedStr  string
	SizeStr     string
	RepoDigests []string
	RepoTags    []string
}

type InfoResponse

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

func (*InfoResponse) Populate

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

Populate fills the InfoResponse struct with data from the 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 PushResponse

type PushResponse = common.PushResponse

type RemoveResponse added in v0.1.14

type RemoveResponse = common.RemoveResponse

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 StopResponse added in v0.1.14

type StopResponse = common.StopResponse

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