Documentation ¶
Overview ¶
Package connectors contains different connectors for fetching the data
Index ¶
- func CLIFlags(id string) ([]cli.Flag, error)
- func ConnectorRegistered(id string) bool
- func RegisterConnector(id, name string, newConnector NewConnectorFunc, CLIFlags ConnectorCLIFlags)
- func RegisteredConnectors() []string
- func ResetConnectors()
- type Connector
- type ConnectorCLIFlags
- type NewConnectorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLIFlags ¶
CLIFlags returns the registered CLI flags of given connector if this connector is missing, error is returned
func ConnectorRegistered ¶
ConnectorRegistered verifies if given connector is registered returns true if yes, false otherwise
func RegisterConnector ¶
func RegisterConnector(id, name string, newConnector NewConnectorFunc, CLIFlags ConnectorCLIFlags)
RegisterConnector registers the new connector for fetching the data. id is used as internal id or as value for CLI flag name is a text name of connector for humans (e.g. help pages) newConnector is the connector constructor function CLIFlag is a function, which returns the configured CLI flags
func RegisteredConnectors ¶
func RegisteredConnectors() []string
RegisteredConnectors returns a slice of registered connector ids
func ResetConnectors ¶
func ResetConnectors()
ResetConnectors resets all registered connectors this is mainly used in the tests
Types ¶
type Connector ¶
type Connector interface { Tags( ctx context.Context, cerr chan<- error, ) ( ctags <-chan data.Tag, ctagsscounter <-chan bool, cmaxtags <-chan int, ) Issues( ctx context.Context, cerr chan<- error, ) ( cissues <-chan data.Issue, cissuescounter <-chan bool, cmaxissues <-chan int, ) MRs( ctx context.Context, cerr chan<- error, ) ( cmr <-chan data.MR, cmrscounter <-chan bool, cmaxmrs <-chan int, ) GetNewTagURL(string) (string, error) RepositoryExists() (bool, error) }
Connector describes the interface of connectors to the data sources
type ConnectorCLIFlags ¶
ConnectorCLIFlags describes the function, which returns the configured CLI flags for particular connector
Directories ¶
Path | Synopsis |
---|---|
Package github implements a github connector
|
Package github implements a github connector |
internal/client
Package client implements the access to the github API package via interface and own wrapper client
|
Package client implements the access to the github API package via interface and own wrapper client |
internal/testclient
Package testclient implements the used interfaces of github API client library and simulates the API answers for our tests
|
Package testclient implements the used interfaces of github API client library and simulates the API answers for our tests |
Package gitlab implements a gitlab connector
|
Package gitlab implements a gitlab connector |
Package helpers provides some helper functions for connectors
|
Package helpers provides some helper functions for connectors |