http

package
v0.0.0-...-5785f03 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiOperationMetrics *http.Metrics
)

Functions

func SpanContextFromRequest

func SpanContextFromRequest(req *fasthttp.Request) (sc trace.SpanContext, ok bool)

func SpanContextFromW3CString

func SpanContextFromW3CString(h string) (sc trace.SpanContext, ok bool)

func TraceStateFromW3CString

func TraceStateFromW3CString(h string) *trace.TraceState

func UpdateSpanStatusFromHTTPStatus

func UpdateSpanStatusFromHTTPStatus(span trace.Span, code int)

Types

type AuthServer

type AuthServer string

enum string for AuthServer

const (
	// AuthServerKuberenetes means we are using kubernetes api server as auth server
	AuthServerKuberenetes AuthServer = "kubernetes"
)

type CORS

type CORS struct {
	Properties map[string]interface{}
}

func (CORS) CORS

CORS middleware to allow CORS. The middleware doesn't override existing headers in incoming requests

type CertProviderConfig

type CertProviderConfig struct {
	Type   string                    `json:"type"`
	Config providers.IProviderConfig `json:"config"`
}

type ClaimRoleMap

type ClaimRoleMap struct {
	Role  string `json:"role"`
	Claim string `json:"claim"`
	Value string `json:"value"`
}

type HttpBinding

type HttpBinding struct {
	CertProvider certs.ICertProvider
	// contains filtered or unexported fields
}

HttpBinding provides service endpoints as a fasthttp web server

func (*HttpBinding) Launch

func (h *HttpBinding) Launch(config HttpBindingConfig, endpoints []v1alpha2.Endpoint, pubsubProvider pubsub.IPubSubProvider) error

Launch fasthttp server

func (*HttpBinding) Shutdown

func (h *HttpBinding) Shutdown(ctx context.Context) error

Shutdown fasthttp server

type HttpBindingConfig

type HttpBindingConfig struct {
	Port         int                `json:"port"`
	Pipeline     []MiddlewareConfig `json:"pipeline"`
	TLS          bool               `json:"tls"`
	CertProvider CertProviderConfig `json:"certProvider"`
}

HttpBindingConfig configures a HttpBinding.

type JWT

type JWT struct {
	AuthHeader string                 `json:"authHeader"`
	VerifyKey  string                 `json:"verifyKey"`
	MustHave   []string               `json:"mustHave,omitempty"`
	MustMatch  map[string]interface{} `json:"mustMatch,omitempty"`
	AuthServer AuthServer             `json:"authServer,omitempty"`

	IgnorePaths []string          `json:"ignorePaths,omitempty"`
	Roles       []ClaimRoleMap    `json:"roles,omitempty"`
	EnableRBAC  bool              `json:"enableRBAC,omitempty"`
	Policy      map[string]Policy `json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (JWT) JWT

type Metrics

type Metrics struct {
	Observability observability.Observability
}

func (Metrics) Metrics

type MiddlewareConfig

type MiddlewareConfig struct {
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties"`
}

MiddlewareConfig configures a HTTP middleware.

type Pipeline

type Pipeline struct {
	Handlers    []Middleware
	Terminators []v1alpha2.Terminable
}

func BuildPipeline

func BuildPipeline(config HttpBindingConfig, pubsubProvider pubsub.IPubSubProvider) (Pipeline, error)

func (Pipeline) Apply

func (Pipeline) Shutdown

func (p Pipeline) Shutdown(ctx context.Context) error

type Policy

type Policy struct {
	Items map[string]string `json:"items"`
}

type Telemetry

type Telemetry struct {
	Properties map[string]interface{}
}

func (Telemetry) Telemetry

CORS middleware to allow CORS. The middleware doesn't override existing headers in incoming requests

type Tracing

type Tracing struct {
	Observability observability.Observability
	Buffer        *v1alpha2.SafeBuffer // this is not used but should be a thread safe buffer
}

func (Tracing) Tracing

type Trail

type Trail struct {
	PubSubProvider pubsub.IPubSubProvider
}

func (*Trail) SetPubSubProvider

func (j *Trail) SetPubSubProvider(provider pubsub.IPubSubProvider)

func (Trail) Trail

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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