spec

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion = "2025-07-01"
	SettingsFile  = "settings.json"
)
View Source
const (
	ThemeNameSystem = "system"
	ThemeNameLight  = "applight"
	ThemeNameDark   = "appdark"
)

Variables

View Source
var (
	ErrInvalidArgument        = errors.New("invalid argument")
	ErrInvalidTheme           = errors.New("invalid app theme")
	ErrInvalidAuthKey         = errors.New("invalid auth key")
	ErrAuthKeyNotFound        = errors.New("auth key not found")
	ErrBuiltInAuthKeyReadOnly = errors.New("built-in auth key is read-only")
)

Functions

This section is empty.

Types

type AppTheme

type AppTheme struct {
	Type ThemeType `json:"type"`
	Name string    `json:"name"`
}

type AuthKey

type AuthKey struct {
	Secret   string `json:"secret"` // encrypted on disk
	SHA256   string `json:"sha256"` // plain text
	NonEmpty bool   `json:"nonEmpty"`
}

AuthKey holds an encrypted secret plus its SHA-256 hash.

type AuthKeyMeta

type AuthKeyMeta struct {
	Type     AuthKeyType `json:"type"`
	KeyName  AuthKeyName `json:"keyName"`
	SHA256   string      `json:"sha256"`
	NonEmpty bool        `json:"nonEmpty"`
}

AuthKeyMeta is the public view of one stored key (no secret, only SHA).

type AuthKeyName

type AuthKeyName string

AuthKeyName is the unique key within its type.

type AuthKeyType

type AuthKeyType string

AuthKeyType groups keys (e.g. "provider", "github").

const AuthKeyTypeProvider AuthKeyType = "provider"

type AuthKeysSchema

type AuthKeysSchema map[AuthKeyType]map[AuthKeyName]AuthKey

type DeleteAuthKeyRequest

type DeleteAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
}

DeleteAuthKeyRequest removes a key (if not built-in).

type DeleteAuthKeyResponse

type DeleteAuthKeyResponse struct{}

type GetAuthKeyRequest

type GetAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
}

GetAuthKeyRequest fetches one decrypted secret.

type GetAuthKeyResponse

type GetAuthKeyResponse struct {
	Body *GetAuthKeyResponseBody
}

type GetAuthKeyResponseBody

type GetAuthKeyResponseBody struct {
	Secret   string `json:"secret"`
	SHA256   string `json:"sha256"`
	NonEmpty bool   `json:"nonEmpty"`
}

type GetSettingsRequest

type GetSettingsRequest struct {
	ForceFetch bool `query:"forceFetch" doc:"Refresh from disk before reading." required:"false"`
}

GetSettingsRequest fetches everything (theme + keys). Secrets are omitted.

type GetSettingsResponse

type GetSettingsResponse struct {
	Body *GetSettingsResponseBody
}

GetSettingsResponse returns the current settings without secrets.

type GetSettingsResponseBody

type GetSettingsResponseBody struct {
	AppTheme AppTheme      `json:"appTheme"`
	AuthKeys []AuthKeyMeta `json:"authKeys"`
}

type SetAppThemeRequest

type SetAppThemeRequest struct {
	Body *SetAppThemeRequestBody
}

type SetAppThemeRequestBody

type SetAppThemeRequestBody struct {
	Type ThemeType `json:"type" required:"true"`
	Name string    `json:"name" required:"true"`
}

type SetAppThemeResponse

type SetAppThemeResponse struct{}

type SetAuthKeyRequest

type SetAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
	Body    *SetAuthKeyRequestBody
}

SetAuthKeyRequest creates or updates a key (idempotent).

type SetAuthKeyRequestBody

type SetAuthKeyRequestBody struct {
	Secret string `json:"secret" required:"true"`
}

type SetAuthKeyResponse

type SetAuthKeyResponse struct{}

type SettingsSchema

type SettingsSchema struct {
	SchemaVersion string         `json:"schemaVersion"`
	AppTheme      AppTheme       `json:"appTheme"`
	AuthKeys      AuthKeysSchema `json:"authKeys"`
}

type ThemeType

type ThemeType string
const (
	ThemeSystem ThemeType = "system"
	ThemeLight  ThemeType = "light"
	ThemeDark   ThemeType = "dark"
	ThemeOther  ThemeType = "other"
)

Jump to

Keyboard shortcuts

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