config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APITokenSourceNone   = "none"
	APITokenSourceConfig = "config"
	APITokenSourceEnv    = "env"
)

Variables

This section is empty.

Functions

func Path

func Path() (string, error)

func Save

func Save(cfg Config) error

func SetAPIToken

func SetAPIToken(token string) error

func UnsetAPIToken

func UnsetAPIToken() error

Types

type APIConfig

type APIConfig struct {
	BaseURL       string `json:"base_url,omitempty"`
	NotionVersion string `json:"notion_version,omitempty"`
	Token         string `json:"token,omitempty"`
}

type APIOverrides

type APIOverrides struct {
	BaseURL       string
	NotionVersion string
	Token         string
}

type Config

type Config struct {
	API APIConfig `json:"api,omitempty"`
}

func Default

func Default() Config

func Load

func Load() (Config, error)

type LoadedConfig

type LoadedConfig struct {
	Config         Config
	Path           string
	APITokenSource string
	HasConfigToken bool
}

func LoadWithMeta

func LoadWithMeta(overrides APIOverrides) (LoadedConfig, error)

Jump to

Keyboard shortcuts

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