Documentation
¶
Index ¶
- Constants
- func CreateHTTPChannel(config ChannelConfiguration) (channel.AppChannel, error)
- type Channel
- func (h *Channel) GetAppConfig(ctx context.Context, appID string) (*config.ApplicationConfig, error)
- func (h *Channel) HealthProbe(ctx context.Context) (bool, error)
- func (h *Channel) InvokeMethod(ctx context.Context, req *invokev1.InvokeMethodRequest, appID string) (*invokev1.InvokeMethodResponse, error)
- func (h *Channel) SetAppHealth(ah *apphealth.AppHealth)
- func (h *Channel) SetAppHealthCheckPath(path string)
- func (h *Channel) TriggerJob(ctx context.Context, name string, data *anypb.Any) (*invokev1.InvokeMethodResponse, error)
- type ChannelConfiguration
- type RWRecorder
Constants ¶
View Source
const (
// HTTPStatusCode is an dapr http channel status code.
HTTPStatusCode = "http.status_code"
)
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPChannel ¶
func CreateHTTPChannel(config ChannelConfiguration) (channel.AppChannel, error)
CreateHTTPChannel creates an HTTP AppChannel.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel is an HTTP implementation of an AppChannel.
func (*Channel) GetAppConfig ¶
func (h *Channel) GetAppConfig(ctx context.Context, appID string) (*config.ApplicationConfig, error)
GetAppConfig gets application config from user application GET http://localhost:<app_port>/dapr/config
func (*Channel) HealthProbe ¶
HealthProbe performs a health probe.
func (*Channel) InvokeMethod ¶
func (h *Channel) InvokeMethod(ctx context.Context, req *invokev1.InvokeMethodRequest, appID string) (*invokev1.InvokeMethodResponse, error)
InvokeMethod invokes user code via HTTP.
func (*Channel) SetAppHealth ¶
SetAppHealth sets the apphealth.AppHealth object.
func (*Channel) SetAppHealthCheckPath ¶
SetAppHealthCheckPath sets the path where to send requests for health probes.
type ChannelConfiguration ¶
type ChannelConfiguration struct { Client *http.Client CompStore *compstore.ComponentStore Endpoint string MaxConcurrency int Middleware middleware.HTTP TracingSpec *config.TracingSpec MaxRequestBodySize int TLSClientCert string TLSClientKey string TLSRootCA string TLSRenegotiation string }
ChannelConfiguration is the configuration used to create an HTTP AppChannel.
type RWRecorder ¶
type RWRecorder struct { W io.ReadWriter // contains filtered or unexported fields }
func (*RWRecorder) Header ¶
func (w *RWRecorder) Header() http.Header
func (*RWRecorder) Result ¶
func (w *RWRecorder) Result() *http.Response
func (*RWRecorder) StatusCode ¶
func (w *RWRecorder) StatusCode() int
func (*RWRecorder) WriteHeader ¶
func (w *RWRecorder) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.