Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultQueueCap = 1000 DefaultPingInterval = time.Second DefaultRequestTimeout = 2 * time.Second )
Variables ¶
View Source
var ( ErrBadQueueCapacity = errors.New("queue capacity invalid") ErrBadRequestTimeout = errors.New("request timeout invalid") ErrBadPingInterval = errors.New("ping interval invalid") ErrSuccessCodes = errors.New("success codes empty") )
View Source
var ErrWriteFailed = errors.New("[loghole-writer] write data to queue failed")
Functions ¶
This section is empty.
Types ¶
type Option ¶
func WithInsecure ¶
func WithInsecure() Option
func WithLogger ¶
func WithPingInterval ¶
func WithQueueCap ¶
func WithRequestTimeout ¶
func WithSuccessCodes ¶
type Options ¶
type Options struct { // Writer settings QueueCap int Logger Logger Servers []string Insecure bool RequestTimeout time.Duration PingInterval time.Duration SuccessCodes []int }
func GetDefaultOptions ¶
func GetDefaultOptions() *Options
GetDefaultOptions returns default configuration options for the client.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
The url can contain secret token e.g. https://secret_token@localhost:50000 Comma separated arrays are also supported, e.g. urlA, urlB. Options start with the defaults but can be overridden.
Click to show internal directories.
Click to hide internal directories.