mifyconfig

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkspaceConfigName = "workspace.mify.yaml"

	GoServicesRoot       = "go-services"
	PythonServicesRoot   = "py-services"
	JsServicesRoot       = "js-services"
	MifyGeneratedDirName = "mify-generated"
)
View Source
const (
	ServiceConfigName = "service.mify.yaml"
)

Variables

View Source
var (
	ErrNoSuchService = errors.New("no such service")
)
View Source
var (
	ErrWorkspaceNotExists = errors.New("workspace doesn't exists")
)

Functions

func FindWorkspaceConfigPath

func FindWorkspaceConfigPath() (string, error)

func FindWorkspaceConfigPathInLocation

func FindWorkspaceConfigPathInLocation(curDir string) (string, error)

func SaveServiceConfig

func SaveServiceConfig(workspaceDir string, serviceName string, conf ServiceConfig) error

Legacy, try to use Dump instead

func SaveWorkspaceConfig

func SaveWorkspaceConfig(path string, conf WorkspaceConfig) error

Types

type ComponentConfig added in v0.1.19

type ComponentConfig struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

func MakeDefaultComponent added in v0.1.19

func MakeDefaultComponent() *ComponentConfig

type ComponentsConfig added in v0.1.19

type ComponentsConfig struct {
	Layout *ComponentConfig `yaml:"layout,omitempty"`
}

type GeneratorParams added in v0.1.19

type GeneratorParams struct {
	Template map[ServiceLanguage]GeneratorTemplateParams `yaml:"template,omitempty"`
}

type GeneratorTemplateParams added in v0.1.19

type GeneratorTemplateParams struct {
	MifyGeneratedPath    string           `yaml:"mify_generated_path,omitempty"`
	MifyGeneratedPackage string           `yaml:"mify_generated_package,omitempty"`
	DevRunner            *ComponentConfig `yaml:"dev_runner,omitempty"`
}

type PostgresConfig

type PostgresConfig struct {
	Enabled      bool   `yaml:"enabled"`
	DatabaseName string `yaml:"database_name,omitempty"`
}

type ServiceConfig

type ServiceConfig struct {
	Language ServiceLanguage `yaml:"language"`
	Template string          `yaml:"template,omitempty"`

	ServiceName string           `yaml:"service_name"`
	Maintainers []string         `yaml:"maintainers"`
	Components  ComponentsConfig `yaml:"components,omitempty"`

	OpenAPI  ServiceOpenAPIConfig `yaml:"openapi,omitempty"`
	Postgres PostgresConfig       `yaml:"postgres,omitempty"`

	IsExternal bool `yaml:"-"`
}

func ReadServiceCfg

func ReadServiceCfg(path string) (*ServiceConfig, error)

func ReadServiceConfig

func ReadServiceConfig(workspaceDir string, serviceName string) (ServiceConfig, error)

TODO: remove (use ReadServiceCfg)

func (ServiceConfig) Dump

func (conf ServiceConfig) Dump(path string) error

type ServiceLanguage

type ServiceLanguage string
const (
	ServiceLanguageUnknown ServiceLanguage = "unknown"
	ServiceLanguageGo      ServiceLanguage = "go"
	ServiceLanguagePython  ServiceLanguage = "python"
	ServiceLanguageJs      ServiceLanguage = "js"
)

type ServiceOpenAPIClientConfig

type ServiceOpenAPIClientConfig struct{}

type ServiceOpenAPIConfig

type ServiceOpenAPIConfig struct {
	Clients map[string]ServiceOpenAPIClientConfig `yaml:"clients,omitempty"`
}

func (ServiceOpenAPIConfig) HasClient

func (s ServiceOpenAPIConfig) HasClient(target string) bool

type WorkspaceConfig

type WorkspaceConfig struct {
	WorkspaceName   string          `yaml:"workspace_name"`
	GitHost         string          `yaml:"git_host"`
	GitNamespace    string          `yaml:"git_namespace"`
	GitRepository   string          `yaml:"git_repository,omitempty"`
	OrganizationID  string          `yaml:"organization_id,omitempty"`
	ProjectName     string          `yaml:"project_name,omitempty"`
	Environments    []string        `yaml:"environments,omitempty"`
	GeneratorParams GeneratorParams `yaml:"generator_params,omitempty"`
}

func ReadWorkspaceConfig

func ReadWorkspaceConfig(path string) (WorkspaceConfig, error)

Jump to

Keyboard shortcuts

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