config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbeddedStoreConfig

type EmbeddedStoreConfig struct {
	Path string `yaml:"path"` // Path is the folder path to storage files
}

EmbeddedStoreConfig is the configuration for embedded store.

type GrafeasConfig

type GrafeasConfig struct {
	API            *ServerConfig        `yaml:"api"`
	StorageType    string               `yaml:"storage_type"` // Supported storage types are "memstore", "postgres" and "embedded"
	PgSQLConfig    *PgSQLConfig         `yaml:"postgres"`
	EmbeddedConfig *EmbeddedStoreConfig `yaml:"embedded"` // EmbeddedConfig is the embedded store config
}

GrafeasConfig is the global configuration for an instance of Grafeas.

func LoadConfig

func LoadConfig(fileName string) (*GrafeasConfig, error)

LoadConfig creates a config from a YAML-file. If fileName is an empty string a default config will be returned.

type PgSQLConfig

type PgSQLConfig struct {
	Host     string `yaml:"host"`
	DbName   string `yaml:"dbname"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	// Valid sslmodes: disable, allow, prefer, require, verify-ca, verify-full.
	// See https://www.postgresql.org/docs/current/static/libpq-connect.html for details
	SSLMode       string `yaml:"sslmode"`
	PaginationKey string `yaml:"paginationkey"`
}

PgSQLConfig is the configuration for PostgreSQL store.

type ServerConfig

type ServerConfig struct {
	Address            string   `yaml:"address"`              // Endpoint address, e.g. localhost:8080 or unix:///var/run/grafeas.sock
	CertFile           string   `yaml:"certfile"`             // A PEM encoded certificate file
	KeyFile            string   `yaml:"keyfile"`              // A PEM encoded private key file
	CAFile             string   `yaml:"cafile"`               // A PEM encoded CA's certificate file
	CORSAllowedOrigins []string `yaml:"cors_allowed_origins"` // Permitted CORS origins.
}

ServerConfig is the Grafeas server configuration.

Jump to

Keyboard shortcuts

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