config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteProfile

func DeleteProfile(name string)

DeleteProfile removes a profile from the configuration

func GetAPIKey

func GetAPIKey() (string, error)

GetAPIKey returns the API key for the current profile

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the config file path

func GetEndpoint

func GetEndpoint() string

GetEndpoint returns the endpoint for the current profile

func Init

func Init(cfgFile, profileName string) error

Init initializes the configuration

func IsDebug

func IsDebug() bool

IsDebug returns whether debug mode is enabled

func ListProfiles

func ListProfiles() []string

ListProfiles returns all profile names

func Save

func Save() error

Save saves the current configuration

func SetDebug

func SetDebug(d bool)

SetDebug sets debug mode

func SetDefaultProfile

func SetDefaultProfile(name string)

SetDefaultProfile sets the default profile name

func SetProfile

func SetProfile(p Profile)

SetProfile sets a profile in the configuration

Types

type Config

type Config struct {
	DefaultProfile string             `json:"default_profile"`
	Profiles       map[string]Profile `json:"profiles"`
}

Config represents the appwrite-cli configuration

func GetConfig

func GetConfig() *Config

GetConfig returns the current configuration

type Profile

type Profile struct {
	Name           string `json:"name"`
	APIKey         string `json:"api_key"`
	Endpoint       string `json:"endpoint,omitempty"`
	DefaultProject string `json:"default_project,omitempty"`
}

Profile represents an authentication profile

func GetProfile

func GetProfile() *Profile

GetProfile returns the current profile

Jump to

Keyboard shortcuts

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