Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessTokenPath ¶
func AccessTokenPath() string
AccessTokenPath is the path for the access token file
func DefaultGlobalConfigPath ¶ added in v0.6.0
func DefaultGlobalConfigPath() string
DefaultGlobalConfigPath returns the default path for the global config file.
func GetProjectConfigFile ¶ added in v0.2.0
func GetProjectConfigFile() string
func GetRootGitRepoDir ¶ added in v0.2.0
func ProjectConfigPath ¶ added in v0.2.0
Types ¶
type Config ¶
type Config struct {
AccessToken string
BaseURL string
Organization string
ServiceTokenName string
ServiceToken string
// Project Configuration
Database string
Branch string
OutputJSON bool
}
Config is dynamically sourced from various files and environment variables.
func (*Config) IsAuthenticated ¶
func (*Config) NewClientFromConfig ¶
NewClientFromConfig creates a PlaentScale API client from our configuration
type GlobalConfig ¶ added in v0.5.0
type GlobalConfig struct {
Organization string `yaml:"org" json:"org"`
}
GlobalConfig is sourced from the global config path and contains globaly configurable options.
func DefaultGlobalConfig ¶ added in v0.5.0
func DefaultGlobalConfig() (*GlobalConfig, error)
DefaultGlobalConfig returns the global config from the default config path.
func (*GlobalConfig) Write ¶ added in v0.5.0
func (g *GlobalConfig) Write(path string) error
Write persists the writable global config at the designated path.
func (*GlobalConfig) WriteDefault ¶ added in v0.6.0
func (g *GlobalConfig) WriteDefault() error
WriteDefault persists the writable global config to the default global path.
type WritableProjectConfig ¶ added in v0.2.0
type WritableProjectConfig struct {
Database string `yaml:"database"`
Branch string `yaml:"branch"`
}
func (*WritableProjectConfig) WriteDefault ¶ added in v0.2.0
func (w *WritableProjectConfig) WriteDefault() error
WriteDefault persists the writable project config at the default path which is pulled from the root of the git repository if a user is in one.