server

package
v0.0.0-...-3116091 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlueprintFetcher

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

func NewBlueprintFetcher

func NewBlueprintFetcher(target string) *BlueprintFetcher

func (*BlueprintFetcher) Fetch

func (f *BlueprintFetcher) Fetch(r *http.Request) (*http.Response, error)

func (*BlueprintFetcher) NewBlueprintRequest

func (f *BlueprintFetcher) NewBlueprintRequest(r *http.Request) (*http.Request, error)

type Handler

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

func NewHandler

func NewHandler(workerTarget string, workerInsecure bool, blueprintTarget string) (*Handler, error)

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) HandleRequest

func (h *Handler) HandleRequest(req *http.Request) (*WorkerResponse, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ScriptFetcher

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

func InitScriptFetcher

func InitScriptFetcher() (*ScriptFetcher, error)

func NewScriptFetcher

func NewScriptFetcher(s3Client *s3.Client, bucket string) *ScriptFetcher

func (*ScriptFetcher) FetchScript

func (s *ScriptFetcher) FetchScript(ctx context.Context, hostname string) (string, error)

type WorkerClient

type WorkerClient struct {
	Client workerapi.WorkerClient
	// contains filtered or unexported fields
}

func NewWorkerClient

func NewWorkerClient(target string, isInsecure bool) (*WorkerClient, error)

func (*WorkerClient) Close

func (c *WorkerClient) Close()

func (*WorkerClient) NewWorkerRequest

func (c *WorkerClient) NewWorkerRequest(ctx context.Context, req *http.Request) (*WorkerRequest, error)

type WorkerRequest

type WorkerRequest struct {
	Client *WorkerClient
	Vmid   string
	Ctx    context.Context
}

func (*WorkerRequest) Compile

func (w *WorkerRequest) Compile(script string) error

func (*WorkerRequest) Run

func (w *WorkerRequest) Run(req *http.Request, res *http.Response) (*WorkerResponse, error)

type WorkerResponse

type WorkerResponse struct {
	*workerapi.RunResponse
}

func (*WorkerResponse) WriteTo

func (w *WorkerResponse) WriteTo(rw http.ResponseWriter)

Jump to

Keyboard shortcuts

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