store

package
v6.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitTokenStore

type GitTokenStore struct {
	// contains filtered or unexported fields
}

GitTokenStore persists token records and auth metadata using git as the backing storage.

func NewGitTokenStore

func NewGitTokenStore(remote, username, password string) *GitTokenStore

NewGitTokenStore creates a token store that saves credentials to disk through the TokenStorage implementation embedded in the token record.

func (*GitTokenStore) AuthDir

func (s *GitTokenStore) AuthDir() string

AuthDir returns the directory used for auth persistence.

func (*GitTokenStore) CommitConfig

func (s *GitTokenStore) CommitConfig(_ context.Context) error

CommitConfig commits and pushes configuration changes to git.

func (*GitTokenStore) CommitPaths

func (s *GitTokenStore) CommitPaths(_ context.Context, message string, paths ...string) error

CommitPaths commits and pushes the provided paths to the remote repository. It no-ops when the store is not fully configured or when there are no paths.

func (*GitTokenStore) ConfigPath

func (s *GitTokenStore) ConfigPath() string

ConfigPath returns the managed config file path.

func (*GitTokenStore) Delete

func (s *GitTokenStore) Delete(_ context.Context, id string) error

Delete removes the auth file.

func (*GitTokenStore) EnsureRepository

func (s *GitTokenStore) EnsureRepository() error

EnsureRepository prepares the local git working tree by cloning or opening the repository.

func (*GitTokenStore) List

List enumerates all auth JSON files under the configured directory.

func (*GitTokenStore) Save

func (s *GitTokenStore) Save(_ context.Context, auth *cliproxyauth.Auth) (string, error)

Save persists token storage and metadata to the resolved auth file path.

func (*GitTokenStore) SetBaseDir

func (s *GitTokenStore) SetBaseDir(dir string)

SetBaseDir updates the default directory used for auth JSON persistence when no explicit path is provided.

Jump to

Keyboard shortcuts

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