config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLogin = errors.New("run `render login` to authenticate")
View Source
var ErrNoWorkspace = errors.New("no workspace set. Use `render workspace set` to set a workspace")

Functions

func ClearProjectFilter

func ClearProjectFilter() error

func DashboardURL

func DashboardURL() string

func GetProjectFilter

func GetProjectFilter() (projectID string, projectName string, err error)

func IsWorkspaceSet

func IsWorkspaceSet() bool

func SetAPIConfig

func SetAPIConfig(input APIConfig) error

func SetDashboardURL

func SetDashboardURL(u string) error

func SetProjectFilter

func SetProjectFilter(projectID string, projectName string) error

func WorkspaceID

func WorkspaceID() (string, error)

func WorkspaceName

func WorkspaceName() (string, error)

Types

type APIConfig

type APIConfig struct {
	Key          string `yaml:"key,omitempty"`
	ExpiresAt    int64  `yaml:"expires_at,omitempty"`
	Host         string `json:"host,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
}

func DefaultAPIConfig

func DefaultAPIConfig() (APIConfig, error)

type Config

type Config struct {
	Version       int    `yaml:"version"`
	Workspace     string `yaml:"workspace"`
	WorkspaceName string `yaml:"workspace_name"`
	ProjectFilter string `yaml:"project_filter,omitempty"` // Project ID for filtering
	ProjectName   string `yaml:"project_name,omitempty"`   // Project name for display

	APIConfig    `yaml:"api"`
	DashboardURL string `yaml:"dashboard_url,omitempty"`
}

func Load

func Load() (*Config, error)

func (*Config) Persist

func (c *Config) Persist() error

Jump to

Keyboard shortcuts

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