Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	StoreTypePersistent = "persistent"
	StoreTypeMemory     = "memory"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GRPCServer  *GRPCServer        `yaml:"grpc-server,omitempty" json:"grpc-server,omitempty"`
	SchemaStore *SchemaStoreConfig `yaml:"schema-store,omitempty" json:"schema-store,omitempty"`
	// Schemas     []*SchemaConfig    `yaml:"schemas,omitempty" json:"schemas,omitempty"`
	Prometheus *PromConfig `yaml:"prometheus,omitempty" json:"prometheus,omitempty"`
}

func New

func New(file string) (*Config, error)

type GRPCServer

type GRPCServer struct {
	Address        string        `yaml:"address,omitempty" json:"address,omitempty"`
	TLS            *TLS          `yaml:"tls,omitempty" json:"tls,omitempty"`
	SchemaServer   *SchemaServer `yaml:"schema-server,omitempty" json:"schema-server,omitempty"`
	MaxRecvMsgSize int           `yaml:"max-recv-msg-size,omitempty" json:"max-recv-msg-size,omitempty"`
	RPCTimeout     time.Duration `yaml:"rpc-timeout,omitempty" json:"rpc-timeout,omitempty"`
}

type PromConfig

type PromConfig struct {
	Address string `yaml:"address,omitempty" json:"address,omitempty"`
}

type RemoteSchemaServer

type RemoteSchemaServer struct {
	Address string `yaml:"address,omitempty" json:"address,omitempty"`
	TLS     *TLS   `yaml:"tls,omitempty" json:"tls,omitempty"`
}

type SchemaConfig

type SchemaConfig struct {
	Name        string   `yaml:"name,omitempty" json:"name,omitempty"`
	Vendor      string   `yaml:"vendor,omitempty" json:"vendor,omitempty"`
	Version     string   `yaml:"version,omitempty" json:"version,omitempty"`
	Files       []string `yaml:"files,omitempty" json:"files,omitempty"`
	Directories []string `yaml:"directories,omitempty" json:"directories,omitempty"`
	Excludes    []string `yaml:"excludes,omitempty" json:"excludes,omitempty"`
}

func (*SchemaConfig) GetSchema

func (sc *SchemaConfig) GetSchema() *sdcpb.Schema

type SchemaPersistStoreCacheConfig

type SchemaPersistStoreCacheConfig struct {
	TTL             time.Duration `yaml:"ttl,omitempty" json:"ttl,omitempty"`
	Capacity        uint64        `yaml:"capacity,omitempty" json:"capacity,omitempty"`
	WithDescription bool          `yaml:"with-description,omitempty" json:"with-description,omitempty"`
}

type SchemaServer

type SchemaServer struct {
	// Enabled          bool   `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	SchemasDirectory string `yaml:"schemas-directory,omitempty" json:"schemas-directory,omitempty"`
}

type SchemaStoreConfig

type SchemaStoreConfig struct {
	Type    string                         `yaml:"type,omitempty" json:"type,omitempty"`
	Path    string                         `yaml:"path,omitempty" json:"path,omitempty"`
	Cache   *SchemaPersistStoreCacheConfig `json:"cache,omitempty"`
	Schemas []*SchemaConfig                `yaml:"schemas,omitempty" json:"schemas,omitempty"`
}

type TLS

type TLS struct {
	CA         string `yaml:"ca,omitempty" json:"ca,omitempty"`
	Cert       string `yaml:"cert,omitempty" json:"cert,omitempty"`
	Key        string `yaml:"key,omitempty" json:"key,omitempty"`
	SkipVerify bool   `yaml:"skip-verify,omitempty" json:"skip-verify,omitempty"`
}

func (*TLS) NewConfig

func (t *TLS) NewConfig(ctx context.Context) (*tls.Config, error)

Jump to

Keyboard shortcuts

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