Maint: cli package interface rework
- return concrete struct type - split interface is sub-interfaces
This commit is contained in:
@@ -1,26 +1,21 @@
|
||||
// Package cli defines an interface CLI to run command line operations.
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
var _ CLIer = (*CLI)(nil)
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
type CLI interface {
|
||||
ClientKey(args []string) error
|
||||
HealthCheck(ctx context.Context, env params.Env, logger logging.Logger) error
|
||||
OpenvpnConfig(logger logging.Logger) error
|
||||
Update(ctx context.Context, args []string, logger logging.Logger) error
|
||||
type CLIer interface {
|
||||
ClientKeyFormatter
|
||||
HealthChecker
|
||||
OpenvpnConfigMaker
|
||||
Updater
|
||||
}
|
||||
|
||||
type cli struct {
|
||||
type CLI struct {
|
||||
repoServersPath string
|
||||
}
|
||||
|
||||
func New() CLI {
|
||||
return &cli{
|
||||
func New() *CLI {
|
||||
return &CLI{
|
||||
repoServersPath: "./internal/constants/servers.json",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user