Documentation
¶
Index ¶
- Variables
- func NewClientTransport(opt ...OptClientTransport) transport.ClientTransport
- func NewElasticClientV7(serviceName string, opts ...client.Option) (*elasticv7.Client, error)
- func NewElasticClientV8(serviceName string, opts ...client.Option) (*elasticv8.Client, error)
- func NewElasticTypedClientV8(serviceName string, opts ...client.Option) (*elasticv8.TypedClient, error)
- type ClientCodec
- type ClientOption
- type ClientTransport
- type Config
- type LogConfig
- type OptClientTransport
- type Plugin
- type RoundTriper
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClientCodec default client codec instance DefaultClientCodec = &ClientCodec{} )
var DefaultClientTransport = NewClientTransport()
DefaultClientTransport default elasticsearch transport instance
Functions ¶
func NewClientTransport ¶
func NewClientTransport(opt ...OptClientTransport) transport.ClientTransport
NewClientTransport create a new transport.ClientTransport
func NewElasticClientV7 ¶
NewElasticClientV7 create a new client
func NewElasticClientV8 ¶
NewElasticClientV8 create a new client
func NewElasticTypedClientV8 ¶
func NewElasticTypedClientV8(serviceName string, opts ...client.Option) (*elasticv8.TypedClient, error)
NewElasticTypedClientV8 create a new typed client
Types ¶
type ClientCodec ¶
type ClientCodec struct{}
ClientCodec client codec instance for request encode/decode
type ClientOption ¶
type ClientOption struct { Name string `yaml:"name"` // name URL string `yaml:"url"` // url User string `yaml:"user"` // user Password string `yaml:"password"` // password Timeout int `yaml:"timeout"` // timeout Log LogConfig `yaml:"log"` // log }
ClientOption goes database connection option
type ClientTransport ¶
type ClientTransport struct {
// contains filtered or unexported fields
}
ClientTransport elasticsearch client transport
func (*ClientTransport) RoundTrip ¶
func (ct *ClientTransport) RoundTrip(ctx context.Context, _ []byte, callOpts ...transport.RoundTripOption) ( []byte, error)
RoundTrip impl transport.ClientTransport interface method
type Config ¶
type Config struct {
ClientsOptions []*ClientOption `yaml:"clientoptions"` // goes database option slice
}
Config goes config struct
type LogConfig ¶
type LogConfig struct { Enabled bool `yaml:"enabled"` // enable log RequestEnabled bool `yaml:"request_enabled"` // enable request body ResponseEnabled bool `yaml:"response_enabled"` // enable response body }
LogConfig is log configuration
type OptClientTransport ¶
type OptClientTransport func(ct *ClientTransport)
OptClientTransport client transport option
func WithHTTPRoundTripper ¶
func WithHTTPRoundTripper(rt http.RoundTripper) OptClientTransport
WithHTTPRoundTripper set http round tripper
type Plugin ¶
type Plugin struct{}
Plugin plugin struct
type RoundTriper ¶
type RoundTriper interface { // RoundTrip elastic client transport method implementation RoundTrip(request *http.Request) (*http.Response, error) }
RoundTriper es client interface
func NewClientProxy ¶
func NewClientProxy(name string, opts ...client.Option) RoundTriper
NewClientProxy create a new elastic client proxy