usecase

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigBody added in v1.0.3

type ConfigBody interface {
	GetBody() string
}

type ConfigChecker added in v1.0.3

type ConfigChecker interface {
	CheckConfigUseFiles() bool
	CheckStringAuthUserPass() bool
}

type ConfigMerger added in v1.0.3

type ConfigMerger interface {
	MergeCertsAndKeys(key string) string
}

type ConfigRemover added in v1.0.3

type ConfigRemover interface {
	RemoveSpaceLines()
	RemoveCommentLines()
	RemoveEmptyString()
	RemoveNotCertsAndKeys()
	RemoveCertsAndKeys()
}

type ConfigSetters added in v1.0.3

type ConfigSetters interface {
	SetBody(body string)
	SetPath(path string)
}

type ConfigTools added in v1.0.3

type ConfigTools interface {
	AddStringToConfig()
	SearchFilesPaths() map[string]string
	GetAuthpathFileName() string
	GetUserAndPass() (string, string)
}

type DnsSetters added in v1.0.3

type DnsSetters interface {
	SetInterface(iface string)
}

type FileGetters added in v1.0.3

type FileGetters interface {
	Path() string
	Body() []byte
}

type FileReader added in v1.0.3

type FileReader interface {
	ReadFileAsByte() ([]byte, error)
	ReadFileAsString() (*string, error)
}

type FileSetters added in v1.0.3

type FileSetters interface {
	SetBody([]byte)
	SetPath(path string)
	SetDestPath(destPath string)
}

type FileToolsManager added in v1.0.3

type FileToolsManager interface {
	FileNameWithoutExtension() *string
	FileOpen() (*os.File, error)
	SetPermissonFile(fs.FileMode)
	CreateFile() (*os.File, error)
	AbsolutePath() (*string, error)
	CopyFile() error
	CheckFileExists() bool
}

type FileWriter added in v1.0.3

type FileWriter interface {
	WriteStringToFile(file *os.File, data string) error
	WriteByteFile() error
}

type ProfileRepository added in v1.0.3

type ProfileRepository interface {
	Store(p entity.Profile)
	Find(key string) entity.Profile
}

type SessionLoger added in v1.0.3

type SessionLoger interface {
	ChanVpnLog() chan string
}

type SessionManager added in v1.0.3

type SessionManager interface {
	StartSession() error
	StopSession()
	DestroyClient()
}

type SessionSetters added in v1.0.3

type SessionSetters interface {
	SetConfig(config string)
	SetCread(u, p string) error
}

type VpnUseCase

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

func NewVpnUseCase added in v1.0.3

func NewVpnUseCase(

	sessionSetters SessionSetters,
	sessionManager SessionManager,
	cfgSetters ConfigSetters,
	cfgBody ConfigBody,
	cfgRemover ConfigRemover,
	cfgCheck ConfigChecker,
	cfgMerg ConfigMerger,
	cfgTools ConfigTools,
	sessionLoger SessionLoger,
	fileSetters FileSetters,
	fileReader FileReader,
	dnsSetters DnsSetters,
) (obj *VpnUseCase, err error)

func (*VpnUseCase) CheckOvpnUseAuthUserPass added in v1.0.3

func (vp *VpnUseCase) CheckOvpnUseAuthUserPass() bool

func (*VpnUseCase) DestroyVpnClient added in v1.0.3

func (vp *VpnUseCase) DestroyVpnClient()

func (*VpnUseCase) ExitSession added in v1.0.3

func (vp *VpnUseCase) ExitSession()

func (*VpnUseCase) GetChanVpnLog added in v1.0.3

func (v *VpnUseCase) GetChanVpnLog() chan string

func (*VpnUseCase) GetOvpnAuthPathFileName added in v1.0.3

func (vp *VpnUseCase) GetOvpnAuthPathFileName() string

func (*VpnUseCase) GetVpnCread added in v1.0.3

func (vp *VpnUseCase) GetVpnCread() (string, string)

func (*VpnUseCase) ReadFile added in v1.0.3

func (vp *VpnUseCase) ReadFile() ([]byte, error)

func (*VpnUseCase) RunSession added in v1.0.3

func (vp *VpnUseCase) RunSession() error

func (*VpnUseCase) SetBodyToCfg added in v1.0.3

func (vp *VpnUseCase) SetBodyToCfg(path string)

func (*VpnUseCase) SetPathToFile added in v1.0.3

func (vp *VpnUseCase) SetPathToFile(path string)

func (*VpnUseCase) SetPhyseInterface added in v1.0.3

func (v *VpnUseCase) SetPhyseInterface(i string)

func (*VpnUseCase) SetProfileBody added in v1.0.3

func (vp *VpnUseCase) SetProfileBody(profileBody string)

func (*VpnUseCase) SetSessionCread added in v1.0.3

func (vp *VpnUseCase) SetSessionCread(u, p string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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