auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetUser(token string) (*api.User, error)
}

API defines the interface for interacting with WriftAI's API.

type Auth

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

Auth represents the struct used to handle authentication related operations.

func NewAuth

func NewAuth(api API, docker Docker, credentials Credentials, console Console) *Auth

NewAuth creates and returns a new Auth struct instance.

func (*Auth) GetToken

func (a *Auth) GetToken() (string, error)

GetToken gets the user's token from the credentials store.

func (*Auth) Login

func (a *Auth) Login(token string) error

Login handles the login process using the provided token.

func (*Auth) Logout

func (a *Auth) Logout() error

Logout handles the logout process of the user.

type Console

type Console interface {
	Infof(format string, a ...interface{})
	Info(message string)
}

Console defines the interface to output formatted messages

type Credentials

type Credentials interface {
	Set(key string, value string) error
	Get(key string) (string, error)
	Delete(key string) error
}

Credentials defines the interface to manage credentials.

type Docker

type Docker interface {
	Login(username string, password string) error
	Logout() error
}

Docker defines the interface for interacting with the Docker CLI.

Jump to

Keyboard shortcuts

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