common

package
v0.0.0-...-3b1e9bc Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBasicKeyringFolder   = ".ark_cache/keyring"
	ArkBasicKeyringFolderEnvVar = "ARK_KEYRING_FOLDER"
)

Variables for basic keyring

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Transport http.RoundTripper
	Username  string
	Password  string
}

BasicAuthTransport is a custom HTTP transport that adds Basic Authentication to requests.

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip NewBasicAuthTransport creates a new BasicAuthTransport with the specified username and password.

type BasicKeyring

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

BasicKeyring is a simple keyring implementation that uses AES encryption to store passwords.

func NewBasicKeyring

func NewBasicKeyring() *BasicKeyring

NewBasicKeyring creates a new BasicKeyring instance. It initializes the keyring folder and file paths.

func (*BasicKeyring) DeletePassword

func (b *BasicKeyring) DeletePassword(serviceName, username string) error

DeletePassword deletes a password for a given service and username from the keyring.

func (*BasicKeyring) GetPassword

func (b *BasicKeyring) GetPassword(serviceName, username string) (string, error)

GetPassword retrieves a password for a given service and username from the keyring.

func (*BasicKeyring) SetPassword

func (b *BasicKeyring) SetPassword(serviceName, username, password string) error

SetPassword sets a password for a given service and username in the keyring.

type HeaderTransport

type HeaderTransport struct {
	Transport http.RoundTripper
	Headers   map[string]string
}

HeaderTransport is a custom HTTP transport that adds headers to requests.

func (*HeaderTransport) RoundTrip

func (t *HeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip NewHeaderTransport creates a new HeaderTransport with the specified headers.

Jump to

Keyboard shortcuts

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