dtconfig

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWebUIOrigin = "https://datatug.app"

DefaultWebUIOrigin is the DataTug web UI the CLI hands off to unless overridden in settings.

Variables

This section is empty.

Functions

func AddProjectToSettings

func AddProjectToSettings(project ProjectRef) error

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)

func SaveSettings

func SaveSettings(settings Settings) error

Types

type AuthCredential

type AuthCredential struct {
	ID    string `json:"GetID"` // 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 ProjectRef

type ProjectRef struct {
	ID     string `yaml:"id"`
	Path   string `yaml:"path,omitempty"`   // Local path
	Origin string `yaml:"origin,omitempty"` // Format: github.com/{owner}/{repo}
	Title  string `yaml:"title"`
}

ProjectRef hold project configuration, specifically path to project directory

func (ProjectRef) Validate

func (v ProjectRef) Validate() error

type ServerConfig

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

type Settings

type Settings struct {
	// Intentionally do not use map
	Projects []*ProjectRef `yaml:"projects,omitempty" json:"projects,omitempty"`

	Client *ClientConfig `yaml:"client,omitempty" json:"client,omitempty"`
	Server *ServerConfig `yaml:"server,omitempty" json:"server,omitempty"`
	WebUI  *WebUIConfig  `yaml:"webui,omitempty" json:"webui,omitempty"`

	Credentials map[string][]AuthCredential `yaml:"credentials,omitempty" json:"credentials,omitempty"`
}

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) *ProjectRef

func (Settings) WebUIOrigin added in v0.11.0

func (v Settings) WebUIOrigin() string

WebUIOrigin returns the configured web UI origin, falling back to DefaultWebUIOrigin.

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

type WebUIConfig added in v0.11.0

type WebUIConfig struct {
	// Origin is the base URL of the web UI, e.g. "https://datatug.app" or "http://localhost:4200".
	Origin string `yaml:"origin,omitempty" json:"origin,omitempty"`
}

WebUIConfig configures the web UI the CLI opens screens in (e.g. via Ctrl+W).

Jump to

Keyboard shortcuts

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