Documentation ¶
Overview ¶
Package http implements the functions, types, and interfaces for the module.
Package http implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- func NewClient(ctx context.Context, cfg *configv1.Service, ss ...OptionSetting) (*transhttp.Client, error)
- func NewServer(cfg *configv1.Service, ss ...OptionSetting) (*transhttp.Server, error)
- type Option
- type OptionSetting
- func WithClientOptions(options ...transhttp.ClientOption) OptionSetting
- func WithDiscovery(serviceName string, discovery registry.Discovery) OptionSetting
- func WithEndpointFunc(endpointFunc func(scheme string, host string, addr string) (string, error)) OptionSetting
- func WithHostIp(hostIp string) OptionSetting
- func WithMiddlewares(middlewares ...middleware.Middleware) OptionSetting
- func WithNodeFilter(filters ...selector.NodeFilter) OptionSetting
- func WithPrefix(prefix string) OptionSetting
- func WithServerOptions(options ...transhttp.ServerOption) OptionSetting
Constants ¶
View Source
const (
Scheme = "http"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v0.1.0
type Option struct { Prefix string HostIp string ServiceName string Discovery registry.Discovery NodeFilters []selector.NodeFilter Middlewares []middleware.Middleware EndpointFunc func(scheme string, host string, addr string) (string, error) ClientOptions []transhttp.ClientOption ServerOptions []transhttp.ServerOption }
type OptionSetting ¶ added in v0.1.0
type OptionSetting = func(o *Option)
func WithClientOptions ¶ added in v0.1.25
func WithClientOptions(options ...transhttp.ClientOption) OptionSetting
func WithDiscovery ¶ added in v0.1.14
func WithDiscovery(serviceName string, discovery registry.Discovery) OptionSetting
func WithEndpointFunc ¶ added in v0.1.14
func WithHostIp ¶ added in v0.1.15
func WithHostIp(hostIp string) OptionSetting
func WithMiddlewares ¶ added in v0.1.14
func WithMiddlewares(middlewares ...middleware.Middleware) OptionSetting
func WithNodeFilter ¶ added in v0.1.0
func WithNodeFilter(filters ...selector.NodeFilter) OptionSetting
func WithPrefix ¶ added in v0.1.15
func WithPrefix(prefix string) OptionSetting
func WithServerOptions ¶ added in v0.1.25
func WithServerOptions(options ...transhttp.ServerOption) OptionSetting
Click to show internal directories.
Click to hide internal directories.