config

package
v0.0.0-...-677932a Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVersion = "v1alpha"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string  `yaml:"version"`
	Module  *Module `yaml:"module"`
}

func NewConfig

func NewConfig(opts ...ConfigOption) *Config

type ConfigOption

type ConfigOption func(*Config)

func WithModulePath

func WithModulePath(path string) ConfigOption

type Logger

type Logger string
var (
	LoggerLogrus Logger = "logrus"
)

TODO add more loggers

type Module

type Module struct {
	Path     string     `yaml:"path"`
	Packages []*Package `yaml:"packages,omitempty"`
	// contains filtered or unexported fields
}

func (*Module) AddPackage

func (m *Module) AddPackage(pkg *Package) error

func (*Module) GetEnvs

func (m *Module) GetEnvs() map[string]bool

func (*Module) GetPackage

func (m *Module) GetPackage(pkgName string) *Package

func (*Module) GetPackageOutDegree

func (m *Module) GetPackageOutDegree(pkg *Package) int

func (*Module) ToDOT

func (m *Module) ToDOT() ([]byte, error)

func (*Module) TopologicalPackageOrder

func (m *Module) TopologicalPackageOrder() ([]*Package, error)

func (*Module) Validate

func (m *Module) Validate() error

type Package

type Package struct {
	ID       string          `yaml:"id"`
	Name     string          `yaml:"name"`
	Path     string          `yaml:"path,omitempty"`
	Config   []PackageConfig `yaml:"config,omitempty"`
	Alias    string          `yaml:"alias,omitempty"`
	Tags     []string        `yaml:"tags,omitempty"`
	Requires []string        `yaml:"requires,omitempty"`
}

func (*Package) AddConfig

func (p *Package) AddConfig(cfg PackageConfig)

func (*Package) Envs

func (p *Package) Envs() []string

func (*Package) FullPath

func (p *Package) FullPath(modPath string) string

FullPath returns the full path (including module path) to the package.

func (*Package) GoAliasName

func (p *Package) GoAliasName() string

func (*Package) GoFileName

func (p *Package) GoFileName() string

func (*Package) GoNewStructFuncName

func (p *Package) GoNewStructFuncName() string

func (*Package) GoStructName

func (p *Package) GoStructName() string

func (*Package) HasTag

func (p *Package) HasTag(tag string) bool

func (*Package) RelativePath

func (p *Package) RelativePath() string

RelativePath returns the relative path from the module root to the package.

type PackageConfig

type PackageConfig struct {
	Name        string `yaml:"name"`
	Type        string `yaml:"type"`
	Description string `yaml:"description"`
	Env         string `yaml:"env"`
	Required    bool   `yaml:"required"`
}

Jump to

Keyboard shortcuts

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