repository

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSuffixBeforeExt

func AddSuffixBeforeExt(filePath, suffix string) string

AddSuffixBeforeExt to add a suffix before the file extension

func CreateConfigDir

func CreateConfigDir() (string, error)

func GetConfigDir

func GetConfigDir() (string, error)

func GetFileNameWithoutExt

func GetFileNameWithoutExt(filePath string) string

func LoadFromYaml

func LoadFromYaml[T any](filename string) (*T, error)

func SaveToYaml

func SaveToYaml[T any](filename string, data *T) error

Types

type FilePath

type FilePath struct {
	Path    string
	NewName string
}

type Filesystem

type Filesystem struct {
	ActiveWorkspace *domain.Workspace
}

func NewFilesystem

func NewFilesystem() (*Filesystem, error)

func (*Filesystem) DeleteCollection

func (f *Filesystem) DeleteCollection(collection *domain.Collection) error

func (*Filesystem) DeleteEnvironment

func (f *Filesystem) DeleteEnvironment(env *domain.Environment) error

func (*Filesystem) DeleteProtoFile

func (f *Filesystem) DeleteProtoFile(protoFile *domain.ProtoFile) error

func (*Filesystem) DeleteRequest

func (f *Filesystem) DeleteRequest(request *domain.Request) error

func (*Filesystem) DeleteWorkspace

func (f *Filesystem) DeleteWorkspace(workspace *domain.Workspace) error

func (*Filesystem) GetCollectionRequestNewFilePath

func (f *Filesystem) GetCollectionRequestNewFilePath(collection *domain.Collection, name string) (*FilePath, error)

func (*Filesystem) GetCollectionsDir

func (f *Filesystem) GetCollectionsDir() (string, error)

func (*Filesystem) GetConfig

func (f *Filesystem) GetConfig() (*domain.Config, error)

func (*Filesystem) GetEnvironment

func (f *Filesystem) GetEnvironment(filepath string) (*domain.Environment, error)

func (*Filesystem) GetEnvironmentDir

func (f *Filesystem) GetEnvironmentDir() (string, error)

func (*Filesystem) GetNewCollectionDir

func (f *Filesystem) GetNewCollectionDir(name string) (*FilePath, error)

func (*Filesystem) GetNewEnvironmentFilePath

func (f *Filesystem) GetNewEnvironmentFilePath(name string) (*FilePath, error)

func (*Filesystem) GetNewProtoFilePath

func (f *Filesystem) GetNewProtoFilePath(name string) (*FilePath, error)

func (*Filesystem) GetNewRequestFilePath

func (f *Filesystem) GetNewRequestFilePath(name string) (*FilePath, error)

func (*Filesystem) GetNewWorkspaceDir

func (f *Filesystem) GetNewWorkspaceDir(name string) (*FilePath, error)

func (*Filesystem) GetProtoFilesDir

func (f *Filesystem) GetProtoFilesDir() (string, error)

func (*Filesystem) GetRequest

func (f *Filesystem) GetRequest(filepath string) (*domain.Request, error)

func (*Filesystem) GetRequestsDir

func (f *Filesystem) GetRequestsDir() (string, error)

func (*Filesystem) GetWorkspace

func (f *Filesystem) GetWorkspace(dirPath string) (*domain.Workspace, error)

func (*Filesystem) GetWorkspacesDir

func (f *Filesystem) GetWorkspacesDir() (string, error)

func (*Filesystem) LoadCollections

func (f *Filesystem) LoadCollections() ([]*domain.Collection, error)

func (*Filesystem) LoadEnvironments

func (f *Filesystem) LoadEnvironments() ([]*domain.Environment, error)

func (*Filesystem) LoadProtoFiles

func (f *Filesystem) LoadProtoFiles() ([]*domain.ProtoFile, error)

func (*Filesystem) LoadRequests

func (f *Filesystem) LoadRequests() ([]*domain.Request, error)

func (*Filesystem) LoadWorkspaces

func (f *Filesystem) LoadWorkspaces() ([]*domain.Workspace, error)

func (*Filesystem) ReadPreferencesData

func (f *Filesystem) ReadPreferencesData() (*domain.Preferences, error)

func (*Filesystem) SetActiveWorkspace

func (f *Filesystem) SetActiveWorkspace(workspace *domain.Workspace) error

func (*Filesystem) UpdateCollection

func (f *Filesystem) UpdateCollection(collection *domain.Collection) error

func (*Filesystem) UpdateConfig

func (f *Filesystem) UpdateConfig(config *domain.Config) error

func (*Filesystem) UpdateEnvironment

func (f *Filesystem) UpdateEnvironment(env *domain.Environment) error

func (*Filesystem) UpdatePreferences

func (f *Filesystem) UpdatePreferences(pref *domain.Preferences) error

func (*Filesystem) UpdateProtoFile

func (f *Filesystem) UpdateProtoFile(protoFile *domain.ProtoFile) error

func (*Filesystem) UpdateRequest

func (f *Filesystem) UpdateRequest(request *domain.Request) error

func (*Filesystem) UpdateWorkspace

func (f *Filesystem) UpdateWorkspace(workspace *domain.Workspace) error

type Repository

type Repository interface {
	LoadCollections() ([]*domain.Collection, error)
	GetCollectionsDir() (string, error)
	UpdateCollection(collection *domain.Collection) error
	DeleteCollection(collection *domain.Collection) error
	GetNewCollectionDir(name string) (*FilePath, error)
	GetCollectionRequestNewFilePath(collection *domain.Collection, name string) (*FilePath, error)

	LoadEnvironments() ([]*domain.Environment, error)
	GetEnvironment(filepath string) (*domain.Environment, error)
	GetEnvironmentDir() (string, error)
	UpdateEnvironment(env *domain.Environment) error
	DeleteEnvironment(env *domain.Environment) error
	GetNewEnvironmentFilePath(name string) (*FilePath, error)

	ReadPreferencesData() (*domain.Preferences, error)
	UpdatePreferences(pref *domain.Preferences) error

	LoadRequests() ([]*domain.Request, error)
	GetRequest(filepath string) (*domain.Request, error)
	GetRequestsDir() (string, error)
	UpdateRequest(request *domain.Request) error
	DeleteRequest(request *domain.Request) error
	GetNewRequestFilePath(name string) (*FilePath, error)

	LoadWorkspaces() ([]*domain.Workspace, error)
	GetWorkspace(filepath string) (*domain.Workspace, error)
	GetWorkspacesDir() (string, error)
	UpdateWorkspace(workspace *domain.Workspace) error
	DeleteWorkspace(workspace *domain.Workspace) error
	GetNewWorkspaceDir(name string) (*FilePath, error)

	GetProtoFilesDir() (string, error)
	LoadProtoFiles() ([]*domain.ProtoFile, error)
	DeleteProtoFile(protoFile *domain.ProtoFile) error
	UpdateProtoFile(protoFile *domain.ProtoFile) error
	GetNewProtoFilePath(name string) (*FilePath, error)

	SetActiveWorkspace(workspace *domain.Workspace) error

	GetConfig() (*domain.Config, error)
	UpdateConfig(config *domain.Config) error
}

Jump to

Keyboard shortcuts

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