http

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatusCodeFromMetadata

func GetStatusCodeFromMetadata(metadata map[string]string) int

GetStatusCodeFromMetadata extracts the http status code from the metadata if it exists

Types

type API

type API interface {
	APIEndpoints() []Endpoint
	MarkStatusAsReady()
}

API returns a list of HTTP endpoints for Dapr

func NewAPI

func NewAPI(appID string, appChannel channel.AppChannel, directMessaging messaging.DirectMessaging, stateStores map[string]state.Store, secretStores map[string]secretstores.SecretStore, publishFn func(*pubsub.PublishRequest) error, actor actors.Actors, sendToOutputBindingFn func(name string, req *bindings.InvokeRequest) (*bindings.InvokeResponse, error), tracingSpec config.TracingSpec) API

NewAPI returns a new API

type Endpoint

type Endpoint struct {
	Methods []string
	Route   string
	Version string
	Handler fasthttp.RequestHandler
}

Endpoint is a collection of route information for an Dapr API

type ErrorResponse

type ErrorResponse struct {
	ErrorCode string `json:"errorCode"`
	Message   string `json:"message"`
}

ErrorResponse is an HTTP response message sent back to calling clients by the Dapr Runtime HTTP API

func NewErrorResponse

func NewErrorResponse(errorCode, message string) ErrorResponse

NewErrorResponse returns a new ErrorResponse

type OutputBindingRequest

type OutputBindingRequest struct {
	Metadata  map[string]string `json:"metadata"`
	Data      interface{}       `json:"data"`
	Operation string            `json:"operation"`
}

OutputBindingRequest is the request object to invoke an output binding

type Server

type Server interface {
	StartNonBlocking()
}

Server is an interface for the Dapr HTTP server

func NewServer

func NewServer(api API, config ServerConfig, tracingSpec config.TracingSpec, pipeline http_middleware.Pipeline) Server

NewServer returns a new HTTP server

type ServerConfig

type ServerConfig struct {
	AllowedOrigins  string
	AppID           string
	HostAddress     string
	Port            int
	ProfilePort     int
	EnableProfiling bool
}

ServerConfig holds config values for an HTTP server

func NewServerConfig

func NewServerConfig(appID string, hostAddress string, port int, profilePort int, allowedOrigins string, enableProfiling bool) ServerConfig

NewServerConfig returns a new HTTP server config

Jump to

Keyboard shortcuts

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