appconfig

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 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

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 AuthCredential

type AuthCredential struct {
	ID    string `json:"ID"` // Like USER or service account ID
	Title string `json:"Title,omitempty"`
}

func (AuthCredential) Validate

func (v AuthCredential) Validate() error

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:"id"`
	Url   string `yaml:"url"`
	Title string `yaml:"title,omitempty"`
}

ProjectConfig hold project configuration, specifically path to project directory

func (ProjectConfig) Validate

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"`

	Credentials map[string][]AuthCredential
}

Settings hold DataTug executable configuration for commands like `serve`

func GetSettings

func GetSettings() (settings Settings, err error)

func (Settings) GetProjectConfig

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

type StoreType

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