repository

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBKeyNotFoundError = errors.New("no such key")

Functions

This section is empty.

Types

type DBRepository added in v0.0.10

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

func NewDBRepository added in v0.0.10

func NewDBRepository() *DBRepository

func (*DBRepository) Count added in v0.0.10

func (repo *DBRepository) Count() int

func (*DBRepository) Keys added in v0.0.10

func (repo *DBRepository) Keys() []string

func (*DBRepository) Omit added in v0.0.10

func (repo *DBRepository) Omit(key string) error

func (*DBRepository) Read added in v0.0.10

func (repo *DBRepository) Read(key string) (interface{}, error)

func (*DBRepository) Write added in v0.0.10

func (repo *DBRepository) Write(key string, value interface{}) error

type DBRepositoryInterface added in v0.0.10

type DBRepositoryInterface interface {
	Keys() []string
	Read(key string) (interface{}, error)
	Write(key string, value interface{}) error
	Omit(key string) error
	Count() int
}

type Env added in v0.0.10

type Env struct {
	WALKHTTP_URL_BASE      string `env:"WALKHTTP_URL_BASE" envDefault:"https://example.com"`
	WALKHTTP_PERSIST_COUNT int    `env:"WALKHTTP_PERSIST_COUNT" envDefault:"100"`
	WALKHTTP_REQUEST_BODY  string `env:"WALKHTTP_REQUEST_BODY" envDefault:"include"`
	WALKHTTP_RESPONSE_BODY string `env:"WALKHTTP_RESPONSE_BODY" envDefault:"include"`
}

func NewEnv added in v0.0.10

func NewEnv() (Env, error)

type FsRepository

type FsRepository struct{}

func (*FsRepository) Create

func (repo *FsRepository) Create(path string, body []byte) error

func (*FsRepository) CreateDir

func (repo *FsRepository) CreateDir(path string) error

func (*FsRepository) HomeDir

func (repo *FsRepository) HomeDir() (string, error)

func (*FsRepository) IsDir

func (repo *FsRepository) IsDir(path string) (bool, error)

func (*FsRepository) IsExist

func (repo *FsRepository) IsExist(path string) bool

func (*FsRepository) ListDirs

func (repo *FsRepository) ListDirs(path string) ([]string, error)

func (*FsRepository) ListFiles

func (repo *FsRepository) ListFiles(path string) ([]string, error)

func (*FsRepository) Read

func (repo *FsRepository) Read(path string) ([]byte, error)

func (*FsRepository) Remove

func (repo *FsRepository) Remove(path string) error

func (*FsRepository) WorkDir

func (repo *FsRepository) WorkDir() (string, error)

type FsRepositoryInterface

type FsRepositoryInterface interface {
	IsExist(path string) bool
	IsDir(path string) (bool, error)
	CreateDir(path string) error
	Create(path string, body []byte) error
	HomeDir() (string, error)
	WorkDir() (string, error)
	Remove(path string) error
	Read(path string) ([]byte, error)
	ListDirs(path string) ([]string, error)
	ListFiles(path string) ([]string, error)
}

type LogMockRepository

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

func (*LogMockRepository) Fatalf

func (repo *LogMockRepository) Fatalf(format string, a ...any)

func (*LogMockRepository) GetAll

func (repo *LogMockRepository) GetAll() string

func (*LogMockRepository) Printf

func (repo *LogMockRepository) Printf(format string, a ...any)

type LogRepository

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

func (*LogRepository) Fatalf

func (repo *LogRepository) Fatalf(format string, a ...any)

func (*LogRepository) GetAll

func (repo *LogRepository) GetAll() string

func (*LogRepository) Printf

func (repo *LogRepository) Printf(format string, a ...any)

type LogRepositoryInterface

type LogRepositoryInterface interface {
	Printf(format string, a ...any)
	Fatalf(format string, a ...any)
	GetAll() string
}

type Prompt

type Prompt struct{}

func (*Prompt) Ask

func (prompt *Prompt) Ask(message string, notice string, value *string) error

func (*Prompt) AskSuggest

func (prompt *Prompt) AskSuggest(message string, notice string, suggestion []string, value *string) error

func (*Prompt) Confirm

func (prompt *Prompt) Confirm(message string, value *bool) error

func (*Prompt) Select

func (prompt *Prompt) Select(options []string, value *string) error

func (*Prompt) Text

func (prompt *Prompt) Text(message string, notice string, value *string) error

type PromptInterface

type PromptInterface interface {
	Confirm(message string, value *bool) error
	Ask(message string, notice string, value *string) error
	AskSuggest(message string, notice string, suggestion []string, value *string) error
	Text(message string, notice string, value *string) error
	Select(options []string, value *string) error
}

type Repos

func New

func New() (Repos, error)

Jump to

Keyboard shortcuts

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