restapi

package
v2.14.3-rc.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderCallerInterceptID = "x-telepresence-caller-intercept-id"
	HeaderInterceptID       = "x-telepresence-intercept-id"
	EndPointConsumeHere     = "/consume-here"
	EndPointInterceptInfo   = "/intercept-info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentState

type AgentState interface {
	// InterceptInfo returns information about an ongoing intercept that matches
	// the given arguments.
	InterceptInfo(ctx context.Context, callerID, path string, containerPort uint16, headers http.Header) (*InterceptInfo, error)
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error,omitempty"`
}

type InterceptInfo added in v2.5.0

type InterceptInfo struct {
	// True if the service is being intercepted
	Intercepted bool `json:"intercepted"`

	// True when queried on the workstation side, false if it is the cluster side agent.
	ClientSide bool `json:"clientSide"`

	// Metadata associated with the intercept. Only available on when Intercepted == ClientSide
	Metadata map[string]string `json:"metadata,omitempty"`
}

type Server

type Server interface {
	ListenAndServe(context.Context, int) error
	Serve(context.Context, net.Listener) error
}

func NewServer

func NewServer(agent AgentState) Server

Jump to

Keyboard shortcuts

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