model

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// ID is unique identifier of the request.
	ID string

	// Route is the original route that matched this request.
	Route

	// Writing is a mutex that prevents two goroutines from writing at
	// the same time in the response.
	Writing sync.Mutex

	// Request is a pointer to the in-progress request.
	Request *http.Request

	// Writer is the original http.ResponseWriter of the request.
	Writer http.ResponseWriter

	// Status is the returned status code
	Status int

	// SentBytes is the number of sent bytes
	SentBytes int64

	// The transfer of the body has started
	BodyOut bool
}

Handler represents an open HTTP connection in the User Server.

This struct contains the connection Writer and Request to be managed by endpoints of the Data Server.

type Route

type Route struct {
	// ID is the unique identifier of the Route.
	ID string `json:"id,omitempty"`

	// Method is the HTTP method that will match this Route.
	Method string `json:"method"`

	// Pattern is the gorilla/mux path pattern that will match this
	// Route.
	Pattern string `json:"url_pattern"`

	// Entrypoint is the string that will be executed when the Route
	// match.
	//
	// This string will be split according to the shell parsing rules to
	// be passed as a list to exec.Command.
	Entrypoint string `json:"entrypoint,omitempty"`

	// Command is the last argument to be passed to exec.Command when
	// executing the Entrypoint
	Command string `json:"command"`

	// Index is this route position in the server's routes list.
	// It is an output field, its value is ignored as input.
	Index int `json:"index"`

	Debug bool `json:"debug,omitempty"`
}

Route contains the data needed to represent a Kapow! user route.

Jump to

Keyboard shortcuts

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