daemon

package
v0.28.5 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TRACE_BUFFER_SIZE = 10_000

Variables

This section is empty.

Functions

func Run

func Run(args Args) error

Types

type Args

type Args struct {
	// Required args.
	ClientID   akid.ClientID
	Domain     string
	DaemonName string

	// Optional args.
	PortNumber uint16

	Plugins []plugin.AkitaPlugin
}

type HTTPResponse

type HTTPResponse rest.HTTPError

Use rest.HTTPError as an HTTP response. Even though its name suggests that it represents an error, HTTPError has all of the elements needed to encapsulate a response.

func EnsureJSONEncodedRequestBody

func EnsureJSONEncodedRequestBody(request *http.Request) *HTTPResponse

Ensures the request body is JSON-encoded. If it is not, returns an HTTPResponse indicating an error. Otherwise, returns nil.

func NewHTTPError

func NewHTTPError(err error, status int, message string) HTTPResponse

Convenience method for creating HTTPResponses that represent errors. If the given error is a rest.HTTPError, then this is used as is, and the remaining arguments are ignored.

func NewHTTPResponse

func NewHTTPResponse(status int, body interface{}) HTTPResponse

HTTPResponse constructor. If the given body cannot be serialized into JSON, this produces a status-500 response with an empty body, and an error is logged.

func (*HTTPResponse) ResponseBody

func (response *HTTPResponse) ResponseBody() []byte

Obtains the JSON body of an HTTP response.

func (*HTTPResponse) ResponseHeaders

func (response *HTTPResponse) ResponseHeaders() (int, map[string]string)

Produces the response code and a set of headers for an HTTP response.

func (*HTTPResponse) Write

func (response *HTTPResponse) Write(writer http.ResponseWriter)

Writes an HTTP response to the network.

type TraceEvent added in v0.14.0

type TraceEvent = har_loader.CustomHAREntry

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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