config

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileName = "config.json"
	ConfigFileDir  = ".alpacon"
)

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(workspaceURL, workspaceName, token, expiresAt, accessToken, refreshToken, baseDomain string, expiresIn int, insecure bool) error

func DeleteConfig

func DeleteConfig() error

func GetSmuxConfig added in v1.0.0

func GetSmuxConfig() *smux.Config

GetSmuxConfig returns a ready-to-use smux configuration.

func SaveRefreshedAuth0Token

func SaveRefreshedAuth0Token(accessToken string, expiresIn int) error

func SwitchWorkspace added in v1.1.0

func SwitchWorkspace(newURL, newName string) error

SwitchWorkspace updates the workspace URL and name in the existing config.

Types

type Config

type Config struct {
	WorkspaceURL         string `json:"workspace_url"`
	WorkspaceName        string `json:"workspace_name"`
	Token                string `json:"token,omitempty"`
	ExpiresAt            string `json:"expires_at,omitempty"`
	AccessToken          string `json:"access_token,omitempty"`
	RefreshToken         string `json:"refresh_token,omitempty"`
	AccessTokenExpiresAt string `json:"access_token_expires_at,omitempty"`
	BaseDomain           string `json:"base_domain,omitempty"`
	Insecure             bool   `json:"insecure"`
}

Config describes the configuration for Alpacon CLI

func LoadConfig

func LoadConfig() (Config, error)

func (Config) IsMultiWorkspaceMode added in v1.1.0

func (c Config) IsMultiWorkspaceMode() bool

IsMultiWorkspaceMode returns true if the user logged in via Auth0 with a known base domain, enabling workspace listing and switching from the JWT.

Jump to

Keyboard shortcuts

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