ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

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

CLI implements the command-line interface

func NewCLI

func NewCLI(service CoreService) *CLI

NewCLI creates a new CLI

func (*CLI) AddClient

func (c *CLI) AddClient(ctx context.Context, name, clientID, clientSecret, tokenURL, scopesStr string) error

AddClient handles the add client flow

func (*CLI) DeleteClient

func (c *CLI) DeleteClient(ctx context.Context, clientName string, force bool) error

DeleteClient handles the delete client flow

func (*CLI) IssueToken

func (c *CLI) IssueToken(ctx context.Context, clientName string) error

IssueToken handles the token issuance flow

func (*CLI) ListClients

func (c *CLI) ListClients(ctx context.Context) error

ListClients handles the list clients flow

func (*CLI) PromptMasterPassword

func (c *CLI) PromptMasterPassword(isNewVault bool) (string, error)

PromptMasterPassword prompts for master password with confirmation for new vault

type CoreService

type CoreService interface {
	AddClient(ctx context.Context, client core.Client) error
	GetClient(ctx context.Context, name string) (*core.Client, error)
	ListClients(ctx context.Context) ([]string, error)
	GetAllClients(ctx context.Context) ([]core.Client, error)
	DeleteClient(ctx context.Context, name string) error
	IssueToken(ctx context.Context, clientName string) (*core.Token, error)
	IsRepositoryInitialized() bool
	CheckPassword(ctx context.Context, password string) error
}

CoreService defines what UI needs from core (interface on consumer side)

type MockCoreService

type MockCoreService struct {
	mock.Mock
}

MockCoreService is an autogenerated mock type for the CoreService type

func NewMockCoreService

func NewMockCoreService(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCoreService

NewMockCoreService creates a new instance of MockCoreService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCoreService) AddClient

func (_m *MockCoreService) AddClient(ctx context.Context, client core.Client) error

AddClient provides a mock function with given fields: ctx, client

func (*MockCoreService) CheckPassword added in v0.0.2

func (_m *MockCoreService) CheckPassword(ctx context.Context, password string) error

CheckPassword provides a mock function with given fields: ctx, password

func (*MockCoreService) DeleteClient

func (_m *MockCoreService) DeleteClient(ctx context.Context, name string) error

DeleteClient provides a mock function with given fields: ctx, name

func (*MockCoreService) EXPECT

func (*MockCoreService) GetAllClients

func (_m *MockCoreService) GetAllClients(ctx context.Context) ([]core.Client, error)

GetAllClients provides a mock function with given fields: ctx

func (*MockCoreService) GetClient

func (_m *MockCoreService) GetClient(ctx context.Context, name string) (*core.Client, error)

GetClient provides a mock function with given fields: ctx, name

func (*MockCoreService) IsRepositoryInitialized

func (_m *MockCoreService) IsRepositoryInitialized() bool

IsRepositoryInitialized provides a mock function with no fields

func (*MockCoreService) IssueToken

func (_m *MockCoreService) IssueToken(ctx context.Context, clientName string) (*core.Token, error)

IssueToken provides a mock function with given fields: ctx, clientName

func (*MockCoreService) ListClients

func (_m *MockCoreService) ListClients(ctx context.Context) ([]string, error)

ListClients provides a mock function with given fields: ctx

type MockCoreService_AddClient_Call

type MockCoreService_AddClient_Call struct {
	*mock.Call
}

MockCoreService_AddClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddClient'

func (*MockCoreService_AddClient_Call) Return

func (*MockCoreService_AddClient_Call) Run

func (*MockCoreService_AddClient_Call) RunAndReturn

type MockCoreService_CheckPassword_Call added in v0.0.2

type MockCoreService_CheckPassword_Call struct {
	*mock.Call
}

MockCoreService_CheckPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckPassword'

func (*MockCoreService_CheckPassword_Call) Return added in v0.0.2

func (*MockCoreService_CheckPassword_Call) Run added in v0.0.2

func (*MockCoreService_CheckPassword_Call) RunAndReturn added in v0.0.2

type MockCoreService_DeleteClient_Call

type MockCoreService_DeleteClient_Call struct {
	*mock.Call
}

MockCoreService_DeleteClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteClient'

func (*MockCoreService_DeleteClient_Call) Return

func (*MockCoreService_DeleteClient_Call) Run

func (*MockCoreService_DeleteClient_Call) RunAndReturn

type MockCoreService_Expecter

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

func (*MockCoreService_Expecter) AddClient

func (_e *MockCoreService_Expecter) AddClient(ctx interface{}, client interface{}) *MockCoreService_AddClient_Call

AddClient is a helper method to define mock.On call

  • ctx context.Context
  • client core.Client

func (*MockCoreService_Expecter) CheckPassword added in v0.0.2

func (_e *MockCoreService_Expecter) CheckPassword(ctx interface{}, password interface{}) *MockCoreService_CheckPassword_Call

CheckPassword is a helper method to define mock.On call

  • ctx context.Context
  • password string

func (*MockCoreService_Expecter) DeleteClient

func (_e *MockCoreService_Expecter) DeleteClient(ctx interface{}, name interface{}) *MockCoreService_DeleteClient_Call

DeleteClient is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockCoreService_Expecter) GetAllClients

func (_e *MockCoreService_Expecter) GetAllClients(ctx interface{}) *MockCoreService_GetAllClients_Call

GetAllClients is a helper method to define mock.On call

  • ctx context.Context

func (*MockCoreService_Expecter) GetClient

func (_e *MockCoreService_Expecter) GetClient(ctx interface{}, name interface{}) *MockCoreService_GetClient_Call

GetClient is a helper method to define mock.On call

  • ctx context.Context
  • name string

func (*MockCoreService_Expecter) IsRepositoryInitialized

IsRepositoryInitialized is a helper method to define mock.On call

func (*MockCoreService_Expecter) IssueToken

func (_e *MockCoreService_Expecter) IssueToken(ctx interface{}, clientName interface{}) *MockCoreService_IssueToken_Call

IssueToken is a helper method to define mock.On call

  • ctx context.Context
  • clientName string

func (*MockCoreService_Expecter) ListClients

func (_e *MockCoreService_Expecter) ListClients(ctx interface{}) *MockCoreService_ListClients_Call

ListClients is a helper method to define mock.On call

  • ctx context.Context

type MockCoreService_GetAllClients_Call

type MockCoreService_GetAllClients_Call struct {
	*mock.Call
}

MockCoreService_GetAllClients_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllClients'

func (*MockCoreService_GetAllClients_Call) Return

func (*MockCoreService_GetAllClients_Call) Run

func (*MockCoreService_GetAllClients_Call) RunAndReturn

type MockCoreService_GetClient_Call

type MockCoreService_GetClient_Call struct {
	*mock.Call
}

MockCoreService_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient'

func (*MockCoreService_GetClient_Call) Return

func (*MockCoreService_GetClient_Call) Run

func (*MockCoreService_GetClient_Call) RunAndReturn

type MockCoreService_IsRepositoryInitialized_Call

type MockCoreService_IsRepositoryInitialized_Call struct {
	*mock.Call
}

MockCoreService_IsRepositoryInitialized_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRepositoryInitialized'

func (*MockCoreService_IsRepositoryInitialized_Call) Return

func (*MockCoreService_IsRepositoryInitialized_Call) Run

func (*MockCoreService_IsRepositoryInitialized_Call) RunAndReturn

type MockCoreService_IssueToken_Call

type MockCoreService_IssueToken_Call struct {
	*mock.Call
}

MockCoreService_IssueToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IssueToken'

func (*MockCoreService_IssueToken_Call) Return

func (*MockCoreService_IssueToken_Call) Run

func (*MockCoreService_IssueToken_Call) RunAndReturn

type MockCoreService_ListClients_Call

type MockCoreService_ListClients_Call struct {
	*mock.Call
}

MockCoreService_ListClients_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListClients'

func (*MockCoreService_ListClients_Call) Return

func (*MockCoreService_ListClients_Call) Run

func (*MockCoreService_ListClients_Call) RunAndReturn

Jump to

Keyboard shortcuts

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