Documentation ¶
Index ¶
- type Agent
- func (a *Agent) GetPlugin(name string) plugins.Plugin
- func (a *Agent) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *Agent) WrapHTTPRequest(parent context.Context, req *http.Request) *http.Request
- func (a *Agent) WrapUserClient(httpDoer plugins.HTTPDoer) plugins.HTTPDoer
- func (a *Agent) WrapUserHandler(handler http.Handler) http.Handler
- func (a *Agent) WrapUserHandlerFunc(handlerFunc http.HandlerFunc) http.HandlerFunc
- type Config
- type ConfigOption
- func WithAddress(address string) ConfigOption
- func WithEaseMeshYAML(yamlFile string) ConfigOption
- func WithSpec(spec plugins.Spec) ConfigOption
- func WithYAML(yamlFile string, localHostPort string) ConfigOption
- func WithZipkinTags(tags map[string]string) ConfigOption
- func WithZipkinYAML(yamlFile string, localHostPort string) ConfigOption
- type HandlerWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the agent entry.
func NewWithOptions ¶
func NewWithOptions(options ...ConfigOption) (*Agent, error)
NewWithOptions returns a new Agent.
func (*Agent) ServeHTTP ¶
func (a *Agent) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP invokes every plugin which is http.Handler to handle the request. NOTE: If the request is not matched for your plugin, don't do anything.
func (*Agent) WrapHTTPRequest ¶
WrapHTTPRequest wraps the request with the parent conext from every enabled plugin.
func (*Agent) WrapUserClient ¶
WrapUserClient wraps the client with the wrap functions from every enabled plugin.
func (*Agent) WrapUserHandler ¶
WrapUserHandler wraps the handler with the wrap functions from every enabled plugin.
func (*Agent) WrapUserHandlerFunc ¶
func (a *Agent) WrapUserHandlerFunc(handlerFunc http.HandlerFunc) http.HandlerFunc
WrapUserHandlerFunc wraps the handlerFunc with the wrap functions from every plugin.
type ConfigOption ¶
type ConfigOption func(c *Config)
ConfigOption allows for functional options to adjust behavior and payload of the Config to be created with agent.Agent().
func WithAddress ¶
func WithAddress(address string) ConfigOption
WithAddress Sets address to Config. @param address string agent http api address @return ConfigOption
func WithEaseMeshYAML ¶
func WithEaseMeshYAML(yamlFile string) ConfigOption
WithZipkinYAML Append easemesh spec load from yaml file to the Agent Plugin Spec. @param yamlFile string yaml file path. use yamlFile="" is use easemesh.DefaultSpec() for @return ConfigOption
func WithSpec ¶
func WithSpec(spec plugins.Spec) ConfigOption
WithSpec Append spec the Agent Plugin Spec. @param spec plugins.Spec @return ConfigOption
func WithYAML ¶
func WithYAML(yamlFile string, localHostPort string) ConfigOption
WithYAML sets address, Append health, easemesh and zipkin spec load from yaml file to the Agent Plugin Spec. @param yamlFile string yaml file path. use yamlFile="" is use easemesh.DefaultSpec() and Console Reporter for tracing. @param localHostPort string host and port of the tracer Span.localEndpoint.
By default, use localHostPort="" is not sets host and port of Span.localEndpoint.
@return ConfigOption
func WithZipkinTags ¶
func WithZipkinTags(tags map[string]string) ConfigOption
WithZipkinTags sets tags of Zipkin Plugin Spec @param tags the Span tags of tracing
func WithZipkinYAML ¶
func WithZipkinYAML(yamlFile string, localHostPort string) ConfigOption
WithZipkinYAML Append zipkin spec load from yaml file to the Agent Plugin Spec.
sets host and port of the tracer Span.localEndpoint.
@param yamlFile string yaml file path. use yamlFile="" is Console Reporter for tracing. @param localHostPort string host and port of the tracer Span.localEndpoint.
By default, use localHostPort="" is not sets host and port of Span.localEndpoint.
@return ConfigOption
type HandlerWrapper ¶
type HandlerWrapper struct {
// contains filtered or unexported fields
}
HandlerWrapper is the HTTP handler wrapper.
func (*HandlerWrapper) ServeHTTP ¶
func (h *HandlerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)