config

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config contains the configuration and loader for protosync.

Index

Constants

This section is empty.

Variables

View Source
var Schema = func() string {
	ast := hcl.MustSchema(&Config{})
	schema, _ := hcl.MarshalAST(ast)
	return string(schema)
}()

Schema of the configuration.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dest        string                       `hcl:"dest,optional" help:"Destination where .proto files will be stored."`
	Remote      resolver.RemoteConfig        `hcl:"remote,block" help:"Configuration for remote repositories."`
	Sources     []string                     `hcl:"sources,optional" help:"List of remote imports or local root globals to resolve imports from."`
	Include     []string                     `hcl:"include,optional" help:"Globbed local include roots to search for proto files (eg. apps/*/protos)."`
	Artifactory []resolver.ArtifactoryConfig `hcl:"artifactory,block" help:"Retrieve protos from JAR files in Artifactory."`
	Repos       []resolver.Repo              `hcl:"repo,block" help:"Defines how to find protos in a source repository."`
}

Config represents the protosync index configuration format.

func Parse

func Parse(config []byte, vars map[string]string) (*Config, error)

Parse configuration.

"vars" will be interpolated into the HCL before unmarshalling.

func (*Config) Decode

func (c *Config) Decode(ctx *kong.DecodeContext) error

func (*Config) Resolve

func (c *Config) Resolve() (resolvers []resolver.Resolver, sources []string, err error)

Resolve config to resolvers and glob-expanded sources.

Jump to

Keyboard shortcuts

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