config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewEKSClientset

func NewEKSClientset(options EKSOptions) (*kubernetes.Clientset, error)

Types

type ConsoleOptions

type ConsoleOptions struct {
	Active bool `yaml:"active" json:"active"`
}

type ConsoleWriter

type ConsoleWriter struct {
}

func (*ConsoleWriter) Close

func (c *ConsoleWriter) Close(context.Context) error

func (*ConsoleWriter) Open

func (*ConsoleWriter) Write

func (c *ConsoleWriter) Write(namespace, pod string, data []byte) error

type EKSOptions

type EKSOptions struct {
	ClusterName string `yaml:"cluster_name" json:"cluster_name"`
	Region      string `yaml:"region" json:"region"`
	AccessKey   string `yaml:"access_key" json:"access_key"`
	SecretKey   string `yaml:"secret_key" json:"secret_key"`
}

type ElasticsearchOptions

type ElasticsearchOptions struct {
	Active   bool   `yaml:"active" json:"active"`
	Host     string `yaml:"host" json:"host"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Index    string `yaml:"index" json:"index"`
}

type ElasticsearchWriter

type ElasticsearchWriter struct {
	Host     string `yaml:"host" json:"host"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Index    string `yaml:"index" json:"index"`
	Client   *elasticsearch.Client
}

func (*ElasticsearchWriter) Close

func (*ElasticsearchWriter) Open

func (*ElasticsearchWriter) Write

func (e *ElasticsearchWriter) Write(namespace string, pod string, log []byte) error

type LogEntry

type LogEntry struct {
	Nanos     int64  `bson:"nanos"`
	Namespace string `bson:"namespace"`
	Pod       string `bson:"pod"`
	Log       string `bson:"log"`
}

type MongoOptions

type MongoOptions struct {
	Active        bool   `yaml:"active" json:"active"`
	ConnectionURI string `yaml:"connection_uri" json:"connection_uri"`
	Database      string `yaml:"database" json:"database"`
	Collection    string `yaml:"collection" json:"collection"`
}

type MongoWriter

type MongoWriter struct {
	ConnectionURI  string `yaml:"connection_uri" json:"connection_uri"`
	DatabaseName   string `yaml:"database" json:"database"`
	CollectionName string `yaml:"collection" json:"collection"`
	Collection     *mongo.Collection
	Client         *mongo.Client
}

func (*MongoWriter) Close

func (m *MongoWriter) Close(ctx context.Context) error

func (*MongoWriter) Open

func (m *MongoWriter) Open(ctx context.Context, uri string) error

func (*MongoWriter) Write

func (m *MongoWriter) Write(namespace string, pod string, log []byte) error

type Options

type Options struct {
	Namespaces           []string              `yaml:"namespaces" json:"namespaces"`
	PodPrefixes          []string              `yaml:"pod_prefixes" json:"pod_prefixes"`
	ClusterProvider      string                `yaml:"cluster_provider" json:"cluster_provider"`
	EKSOptions           EKSOptions            `yaml:"eks" json:"eks"`
	MongoOptions         *MongoOptions         `yaml:"mongo" json:"mongo"`
	ElasticsearchOptions *ElasticsearchOptions `yaml:"elasticsearch" json:"elasticsearch"`
	ConsoleOptions       *ConsoleOptions       `yaml:"console" json:"console"`
}

func NewOptions

func NewOptions(paths ...string) (*Options, error)

type Writer

type Writer interface {
	Open(context.Context, string) error
	Write(namespace, pod string, log []byte) error
	Close(context.Context) error
}

func NewConsoleWriter

func NewConsoleWriter() Writer

func NewElasticsearchWriter

func NewElasticsearchWriter(host, username, password, index string) Writer

func NewMongoWriter

func NewMongoWriter(database, collection string) Writer

Jump to

Keyboard shortcuts

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