http

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 16 Imported by: 0

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

View Source
const (
	Scheme = "http"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, cfg *configv1.Service, ss ...Option) (*transhttp.Client, error)

NewClient Creating an HTTP client instance.

func NewServer

func NewServer(cfg *configv1.Service, ss ...Option) (*transhttp.Server, error)

NewServer Create an HTTP server instance.

Types

type EndpointFunc added in v0.1.56

type EndpointFunc = func(scheme string, host string, addr string) (string, error)

type Option added in v0.1.0

type Option = func(o *Options)

func WithClientOptions added in v0.1.25

func WithClientOptions(options ...transhttp.ClientOption) Option

func WithDiscovery added in v0.1.14

func WithDiscovery(serviceName string, discovery registry.Discovery) Option

func WithEndpointFunc added in v0.1.14

func WithEndpointFunc(endpointFunc EndpointFunc) Option

func WithHostIp added in v0.1.15

func WithHostIp(hostIp string) Option

func WithMiddlewares added in v0.1.14

func WithMiddlewares(middlewares ...middleware.Middleware) Option

func WithNodeFilter added in v0.1.0

func WithNodeFilter(filters ...selector.NodeFilter) Option

func WithPrefix added in v0.1.15

func WithPrefix(prefix string) Option

func WithServerOptions added in v0.1.25

func WithServerOptions(options ...transhttp.ServerOption) Option

type Options added in v0.1.56

type Options struct {
	Prefix        string
	HostIp        string
	ServiceName   string
	Discovery     registry.Discovery
	NodeFilters   []selector.NodeFilter
	Middlewares   []middleware.Middleware
	EndpointFunc  EndpointFunc
	ClientOptions []transhttp.ClientOption
	ServerOptions []transhttp.ServerOption
}

Jump to

Keyboard shortcuts

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