handler

package
v0.1.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewRequest

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

CreateNewRequest creates a new HTTP request

func EnsureImageTag

func EnsureImageTag(imageName *string)

func FieldCheck

func FieldCheck(a *cli.App) error

func HandleExistingContainer added in v0.1.14

func HandleExistingContainer(a *cli.App, deployResponse *common.DeployResponse) 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 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 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

Jump to

Keyboard shortcuts

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