connectors

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package connectors contains different connectors for fetching the data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIFlags

func CLIFlags(id string) ([]cli.Flag, error)

CLIFlags returns the registered CLI flags of given connector if this connector is missing, error is returned

func ConnectorRegistered

func ConnectorRegistered(id string) bool

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

func NewConnector

func NewConnector(id string, ctx *cli.Context) (Connector, error)

NewConnector returns the Connector of given id if this connector is missing, error is returned

type ConnectorCLIFlags

type ConnectorCLIFlags func() []cli.Flag

ConnectorCLIFlags describes the function, which returns the configured CLI flags for particular connector

type NewConnectorFunc

type NewConnectorFunc func(*cli.Context) (Connector, error)

NewConnectorFunc describes the constructor of 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

Jump to

Keyboard shortcuts

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