-
Notifications
You must be signed in to change notification settings - Fork 72
/
factory.go
29 lines (26 loc) · 1.02 KB
/
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
27
28
29
package factory
import (
"context"
"github.com/redhat-developer/app-services-cli/pkg/core/config"
"github.com/redhat-developer/app-services-cli/pkg/core/connection"
"github.com/redhat-developer/app-services-cli/pkg/core/ioutil/iostreams"
"github.com/redhat-developer/app-services-cli/pkg/core/localize"
"github.com/redhat-developer/app-services-cli/pkg/core/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
// Context returns the default context for the application
Context context.Context
}
type ConnectionFunc func(cfg *connection.Config) (connection.Connection, error)