CovenantSQL: Index | Files

package config

import ""

Package config defines the configuration objects for adapter.


Package Files

config.go doc.go errors.go


var (
    // ErrInvalidStorageConfig defines error on incomplete storage config.
    ErrInvalidStorageConfig = errors.New("invalid storage config")
    // ErrInvalidCertificateFile defines invalid certificate file error.
    ErrInvalidCertificateFile = errors.New("invalid certificate file")

type Config Uses

type Config struct {
    // server related
    ListenAddr        string          `yaml:"ListenAddr"`
    CertificatePath   string          `yaml:"CertificatePath"`
    PrivateKeyPath    string          `yaml:"PrivateKeyPath"`
    ServerCertificate tls.Certificate `yaml:"-"`
    TLSConfig         *tls.Config     `yaml:"-"`

    // client related
    VerifyCertificate bool                `yaml:"VerifyCertificate"`
    ClientCAPath      string              `yaml:"ClientCAPath"`
    ClientCertPool    *x509.CertPool      `yaml:"-"`
    AdminCertFiles    []string            `yaml:"AdminCerts"`
    WriteCertFiles    []string            `yaml:"WriteCerts"`
    AdminCertificates []*x509.Certificate `yaml:"-"`
    WriteCertificates []*x509.Certificate `yaml:"-"`

    // storage config
    MirrorServer    string          `yaml:"Mirror"`        // use mirror server for queries
    StorageDriver   string          `yaml:"StorageDriver"` // sqlite3 or covenantsql
    StorageRoot     string          `yaml:"StorageRoot"`
    StorageInstance storage.Storage `yaml:"-"`

Config defines adapter specific configuration.

func GetConfig Uses

func GetConfig() *Config

GetConfig returns global initialized config.

func LoadConfig Uses

func LoadConfig(configPath string) (config *Config, err error)

LoadConfig load and verify config in config file (Reuse some global config instance values). Should call conf.LoadConfig before use. e.g client.Init

Package config imports 12 packages (graph) and is imported by 4 packages. Updated 2019-03-25. Refresh now. Tools for package owners.