server/cmd/harp-server/internal/config/config.go (52 lines of code) (raw):

// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package config import "github.com/elastic/harp/pkg/sdk/platform" // Configuration contains qualysbeat settings type Configuration struct { Debug struct { Enable bool `toml:"enable" default:"false" comment:"allow debug mode"` } `toml:"Debug" comment:"###############################\n Debug with gops \n##############################"` Instrumentation platform.InstrumentationConfig `toml:"Instrumentation" comment:"###############################\n Instrumentation \n##############################"` HTTP struct { Network string `toml:"network" default:"tcp" comment:"Network class used for listen (tcp, tcp4, tcp6, unixsocket)"` Listen string `toml:"listen" default:":8080" comment:"Listen address for HTTP server"` UseTLS bool `toml:"useTLS" default:"false" comment:"Enable TLS listener"` TLS struct { CertificatePath string `toml:"certificatePath" default:"" comment:"Certificate path"` PrivateKeyPath string `toml:"privateKeyPath" default:"" comment:"Private Key path"` CACertificatePath string `toml:"caCertificatePath" default:"" comment:"CA Certificate Path"` ClientAuthenticationRequired bool `toml:"clientAuthenticationRequired" default:"false" comment:"Force client authentication"` } `toml:"TLS" comment:"TLS Socket settings"` } `toml:"HTTP" comment:"###############################\n HTTP Settings \n##############################"` Vault struct { Network string `toml:"network" default:"tcp" comment:"Network class used for listen (tcp, tcp4, tcp6, unixsocket)"` Listen string `toml:"listen" default:":8200" comment:"Listen address for fake Vault server"` UseTLS bool `toml:"useTLS" default:"false" comment:"Enable TLS listener"` TLS struct { CertificatePath string `toml:"certificatePath" default:"" comment:"Certificate path"` PrivateKeyPath string `toml:"privateKeyPath" default:"" comment:"Private Key path"` CACertificatePath string `toml:"caCertificatePath" default:"" comment:"CA Certificate Path"` ClientAuthenticationRequired bool `toml:"clientAuthenticationRequired" default:"false" comment:"Force client authentication"` } `toml:"TLS" comment:"TLS Socket settings"` } `toml:"Vault" comment:"###############################\n Vault Settings \n##############################"` GRPC struct { Network string `toml:"network" default:"tcp" comment:"Network class used for listen (tcp, tcp4, tcp6, unixsocket)"` Listen string `toml:"listen" default:":8085" comment:"Listen address for gRPC server"` UseTLS bool `toml:"useTLS" default:"false" comment:"Enable TLS listener"` TLS struct { CertificatePath string `toml:"certificatePath" default:"" comment:"Certificate path"` PrivateKeyPath string `toml:"privateKeyPath" default:"" comment:"Private Key path"` CACertificatePath string `toml:"caCertificatePath" default:"" comment:"CA Certificate Path"` ClientAuthenticationRequired bool `toml:"clientAuthenticationRequired" default:"false" comment:"Force client authentication"` } `toml:"TLS" comment:"TLS Socket settings"` } `toml:"gRPC" comment:"###############################\n gRPC Settings \n##############################"` Backends []Backend `toml:"Backends" default:"" comment:"###############################\n Backends \n##############################"` Transformers []Transformer `toml:"Transformers" default:"" comment:"###############################\n Tranformers \n##############################"` Keyring []string `toml:"Keyring" default:"" comment:"###############################\n Container Keyring \n##############################"` } // Backend represents backend mapping settings type Backend struct { NS string `toml:"ns" default:"" comment:"Backend mount namespace"` URL string `toml:"url" default:"" comment:"Backend settings url"` } // Transformer represents transformer mapping settings type Transformer struct { Name string `toml:"name" default:"" comment:"Transformer key name"` Key string `toml:"key" default:"" comment:"Transformer key"` }