Documentation ¶
Index ¶
Constants ¶
Variables ¶
View Source
var (
ErrNoTlsConfig = errors.New("tls config is not exist")
)
View Source
var ErrParseRootCertFailed = errors.New("failed to parse root certificate")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(logger log.Logger, cfg ClientConfig, handler func(req *logproto.PushRequest)) *Client
func (*Client) ConnectTcp ¶
func (*Client) IsShutdown ¶
IsShutdown client is shutdown or not.
func (*Client) IsStopping ¶
IsStopping client is stopping or not.
func (*Client) TlsConnect ¶
type ClientConfig ¶
type ClientConfig struct { Host string `yaml:"host"` Port int `yaml:"port"` MaxMessageLength int `yaml:"max_message_length"` ConnectTimeout time.Duration `yaml:"connect_timeout"` IdleTimeout time.Duration `yaml:"idle_timeout"` KeepalivePeriod time.Duration `yaml:"keepalive_period"` // If it is zero we don't set keepalive HeartbeatInterval time.Duration `yaml:"heart_interval"` ReconnectInterval time.Duration `yaml:"reconnect_interval"` // If it is zero we don't reconnect TLSConfig TLSConfig `yaml:"tls_config,omitempty"` // TLSConfig to use to connect to the targets. }
type ServerConfig ¶
type ServerConfig struct { ForwardEnable bool `yaml:"enable"` ForwardListenAddress string `yaml:"listen_address"` ForwardListenPort int `yaml:"listen_port"` ForwardConnLimit int `yaml:"listen_conn_limit"` ForwardReadTimeout time.Duration `yaml:"read_timeout"` ForwardWriteTimeout time.Duration `yaml:"write_timeout"` ForwardKeepalivePeriod time.Duration `yaml:"keepalive_period"` ForwardTLSConfig TLSConfig `yaml:"tls_config,omitempty"` }
func (*ServerConfig) RegisterFlags ¶
func (cfg *ServerConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet
func (*ServerConfig) RegisterFlagsWithPrefix ¶
func (cfg *ServerConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix with prefix registers flags where every name is prefixed by prefix. If prefix is a non-empty string, prefix should end with a period.
Click to show internal directories.
Click to hide internal directories.