handler

package
v0.1.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndRefreshAuth added in v0.1.15

func CheckAndRefreshAuth(a *cli.App) error

func CreateNewRequest

func CreateNewRequest(method, url string, body []byte) (*http.Request, error)

CreateNewRequest creates a new HTTP request

func EnsureImageTag

func EnsureImageTag(imageName *string) error

func ExportDockerImage added in v0.1.15

func ExportDockerImage(imageName string) (io.ReadCloser, int64, error)

func FieldCheck

func FieldCheck(a *cli.App) error

func HandleExistingContainer added in v0.1.14

func HandleExistingContainer(app *cli.App, conflictResp *common.ConflictCheckResponse) error

func PrepareJSONPayload

func PrepareJSONPayload(payload common.Payload) ([]byte, error)

PrepareJSONPayload marshals the payload into JSON

func ReAuthenticate

func ReAuthenticate(a *cli.App) error

func SendRequest

func SendRequest(req *http.Request) (*http.Response, error)

SendRequest sends the HTTP request and returns the response

func StartServer

func StartServer(a *server.App, port string) error

func ValidateImageName

func ValidateImageName(imageName string) error

func ValidatePortMapping

func ValidatePortMapping(port string) error

func ValidateTargetDomain

func ValidateTargetDomain(targetDomain string) error

Types

type ChunkMetadata added in v0.1.15

type ChunkMetadata = common.ChunkMetadata

type ChunkedClient added in v0.1.15

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

func NewChunkedClient added in v0.1.15

func NewChunkedClient(app *cli.App) *ChunkedClient

NewChunkedClient creates a new chunked client

func (*ChunkedClient) Cancel added in v0.1.15

func (c *ChunkedClient) Cancel()

func (*ChunkedClient) SendFileAsChunks added in v0.1.15

func (c *ChunkedClient) SendFileAsChunks(ctx context.Context, endpoint string, headers http.Header, reader io.Reader, totalSize int64, imageName string) (*Response, error)

SendFileAsChunks sends a file as chunks to the specified endpoint

type PingResponse

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

Define a struct to match the JSON response structure

func PerformPingRequest

func PerformPingRequest(a *cli.App) (PingResponse, error)

type ProgressDisplay added in v0.1.15

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

ProgressDisplay manages the upload progress display

func NewProgressDisplay added in v0.1.15

func NewProgressDisplay() *ProgressDisplay

NewProgressDisplay creates a new progress display

func (*ProgressDisplay) Clear added in v0.1.15

func (pd *ProgressDisplay) Clear()

func (*ProgressDisplay) Pause added in v0.1.15

func (pd *ProgressDisplay) Pause()

func (*ProgressDisplay) Resume added in v0.1.15

func (pd *ProgressDisplay) Resume()

func (*ProgressDisplay) Start added in v0.1.15

func (pd *ProgressDisplay) Start()

func (*ProgressDisplay) Stop added in v0.1.15

func (pd *ProgressDisplay) Stop()

func (*ProgressDisplay) Update added in v0.1.15

func (pd *ProgressDisplay) Update(completed, total int, percentage float64)

type Response

type Response struct {
	Http       *http.Response
	Header     http.Header
	Body       []byte
	StatusCode int
}

func SendHTTPRequest

func SendHTTPRequest(a *cli.App, rp *common.RequestPayload, method string, endpoint string) (*Response, error)

SendHTTPRequest sends the HTTP request

type UploadProgress added in v0.1.15

type UploadProgress struct {
	Completed  int
	Total      int
	Percentage float64
}

UploadProgress represents the current state of the upload

Jump to

Keyboard shortcuts

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