-
Notifications
You must be signed in to change notification settings - Fork 72
/
factory.go
26 lines (23 loc) · 921 Bytes
/
factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package factory
import (
"github.com/redhat-developer/app-services-cli/internal/config"
"github.com/redhat-developer/app-services-cli/pkg/connection"
"github.com/redhat-developer/app-services-cli/pkg/iostreams"
"github.com/redhat-developer/app-services-cli/pkg/localize"
"github.com/redhat-developer/app-services-cli/pkg/logging"
)
// Factory is an abstract type which provides access to
// the root configuration and connections for the CLI
type Factory struct {
// Type which defines the streams for the CLI
IOStreams *iostreams.IOStreams
// Interface to read/write to the config
Config config.IConfig
// Creates a connection to the API
Connection ConnectionFunc
// Returns a logger to create leveled logs in the application
Logger logging.Logger
// Localizer provides text to the commands
Localizer localize.Localizer
}
type ConnectionFunc func(cfg *connection.Config) (connection.Connection, error)