config

package
v0.4.77 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost       = "localhost"
	DefaultClientPort = 4200
	DefaultServerPort = 8989
)
View Source
const ConfigFileName = ".datatug.yaml"
View Source
const FileStoreUrlPrefix = "file:"

Variables

This section is empty.

Functions

func GetConfigFilePath added in v0.3.0

func GetConfigFilePath() string

func PrintSection

func PrintSection(section interface{ IsEmpty() bool }, format Format, w io.Writer) (err error)

func PrintSettings

func PrintSettings(settings Settings, format Format, w io.Writer) (err error)

Types

type ClientConfig

type ClientConfig struct {
	UrlConfig `yaml:",inline"`
}

type Format

type Format string
const (
	FormatYaml Format = "yaml"
)

type ProjectConfig

type ProjectConfig struct {
	ID    string `yaml:"-"`
	Url   string `yaml:"url"`
	Title string `yaml:"title,omitempty"`
}

ProjectConfig hold project configuration, specifically path to project directory

func (ProjectConfig) Validate added in v0.3.0

func (v ProjectConfig) Validate() error

type ServerConfig

type ServerConfig struct {
	UrlConfig `yaml:",inline"`
}

type Settings

type Settings struct {
	Projects []*ProjectConfig `yaml:"projects,omitempty"` // Intentionally do not use map
	Client   *ClientConfig    `yaml:"client,omitempty"`
	Server   *ServerConfig    `yaml:"server,omitempty"`
}

Settings hold DataTug executable configuration for commands like `serve`

func GetSettings

func GetSettings() (settings Settings, err error)

func (Settings) GetProjectConfig added in v0.3.0

func (v Settings) GetProjectConfig(projectID string) *ProjectConfig

type StoreType added in v0.3.0

type StoreType string

type UrlConfig

type UrlConfig struct {
	Host string `yaml:"host,omitempty"`
	Port int    `yaml:"port,omitempty"`
}

UrlConfig holds host name and port

func (*UrlConfig) IsEmpty

func (v *UrlConfig) IsEmpty() bool

Jump to

Keyboard shortcuts

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