federation

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFederator

func RunFederator(configPath string)

RunFederator .....

func SetupHTTPServer

func SetupHTTPServer(responder Responder)

SetupHTTPServer .....

Types

type APIModel

type APIModel struct {
	// map of hub URL to ... ? hub info?
	Hubs map[string]*api.ModelHub
}

APIModel ...

type APIProject

type APIProject struct {
	Name string
	URL  string
}

APIProject ...

type APIProjectSearchRequest

type APIProjectSearchRequest struct {
	ProjectName string
}

APIProjectSearchRequest ...

type APIProjectSearchResponse

type APIProjectSearchResponse struct {
	// map of hubBaseURL to project
	Projects map[string]*APIProject
}

APIProjectSearchResponse ...

type APISetHubsRequest

type APISetHubsRequest struct {
	HubURLs []string
}

APISetHubsRequest ...

type APIUpdateConfigRequest

type APIUpdateConfigRequest struct {
}

APIUpdateConfigRequest ...

type Config

type Config struct {
	HubConfig   *HubConfig
	UseMockMode bool
	Port        int
	LogLevel    string
}

Config ...

func GetConfig

func GetConfig(configPath string) (*Config, error)

GetConfig returns a configuration object to configure Perceptor

func (*Config) GetLogLevel

func (config *Config) GetLogLevel() (log.Level, error)

GetLogLevel .....

type FedAction

type FedAction interface {
	FedApply(federator *Federator)
}

FedAction ...

type FedFindProject

type FedFindProject struct {
	Request  APIProjectSearchRequest
	Response chan *APIProjectSearchResponse
}

FedFindProject ...

func NewFedFindProject

func NewFedFindProject(request APIProjectSearchRequest) *FedFindProject

NewFedFindProject ...

func (*FedFindProject) FedApply

func (ffp *FedFindProject) FedApply(federator *Federator)

FedApply ...

type FedGetModel

type FedGetModel struct {
	Done chan *APIModel
}

FedGetModel ...

func NewFedGetModel

func NewFedGetModel() *FedGetModel

NewFedGetModel ...

func (*FedGetModel) FedApply

func (fgm *FedGetModel) FedApply(federator *Federator)

FedApply ...

type FedSetHubs

type FedSetHubs struct {
	HubBaseURLs []string
}

FedSetHubs ...

func (*FedSetHubs) FedApply

func (fsh *FedSetHubs) FedApply(federator *Federator)

FedApply ...

type FedUpdateConfig

type FedUpdateConfig struct {
}

FedUpdateConfig ...

func (*FedUpdateConfig) FedApply

func (fconf *FedUpdateConfig) FedApply(federator *Federator)

FedApply ...

type Federator

type Federator struct {
	// contains filtered or unexported fields
}

Federator ...

func NewFederator

func NewFederator(config *Config) (*Federator, error)

NewFederator ...

type HTTPResponder

type HTTPResponder struct {
	RequestsCh chan FedAction
}

HTTPResponder ...

func NewHTTPResponder

func NewHTTPResponder() *HTTPResponder

NewHTTPResponder .....

func (*HTTPResponder) Error

func (hr *HTTPResponder) Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)

Error .....

func (*HTTPResponder) FindProject

FindProject ...

func (*HTTPResponder) GetModel

func (hr *HTTPResponder) GetModel() *APIModel

GetModel .....

func (*HTTPResponder) NotFound

func (hr *HTTPResponder) NotFound(w http.ResponseWriter, r *http.Request)

NotFound .....

func (*HTTPResponder) SetHubs

func (hr *HTTPResponder) SetHubs(hubs *APISetHubsRequest)

SetHubs ...

func (*HTTPResponder) UpdateConfig

func (hr *HTTPResponder) UpdateConfig(config *APIUpdateConfigRequest)

UpdateConfig ...

type HubConfig

type HubConfig struct {
	User                         string
	PasswordEnvVar               string
	ClientTimeoutMilliseconds    int
	Port                         int
	FetchAllProjectsPauseSeconds int
}

HubConfig ...

func (*HubConfig) ClientTimeout

func (config *HubConfig) ClientTimeout() time.Duration

ClientTimeout converts the milliseconds to a duration

func (*HubConfig) FetchAllProjectsPause

func (config *HubConfig) FetchAllProjectsPause() time.Duration

FetchAllProjectsPause converts the minutes to a duration

type HubCreationResult

type HubCreationResult struct {
	// contains filtered or unexported fields
}

HubCreationResult ...

func (*HubCreationResult) FedApply

func (hcr *HubCreationResult) FedApply(federator *Federator)

FedApply ...

type HubCreator

type HubCreator struct {
	// contains filtered or unexported fields
}

HubCreator ...

func NewHubCreator

func NewHubCreator(hubConfig *HubConfig) (*HubCreator, error)

NewHubCreator ...

type MockResponder

type MockResponder struct{}

MockResponder ...

func NewMockResponder

func NewMockResponder() *MockResponder

NewMockResponder ...

func (*MockResponder) Error

func (mr *MockResponder) Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)

Error ...

func (*MockResponder) FindProject

FindProject ...

func (*MockResponder) GetModel

func (mr *MockResponder) GetModel() *APIModel

GetModel ...

func (*MockResponder) NotFound

func (mr *MockResponder) NotFound(w http.ResponseWriter, r *http.Request)

NotFound ...

func (*MockResponder) SetHubs

func (mr *MockResponder) SetHubs(hubs *APISetHubsRequest)

SetHubs ...

func (*MockResponder) UpdateConfig

func (mr *MockResponder) UpdateConfig(config *APIUpdateConfigRequest)

UpdateConfig ...

type Responder

type Responder interface {
	GetModel() *APIModel
	//
	SetHubs(hubs *APISetHubsRequest)
	UpdateConfig(config *APIUpdateConfigRequest)
	//
	FindProject(request APIProjectSearchRequest) *APIProjectSearchResponse
	// errors
	NotFound(w http.ResponseWriter, r *http.Request)
	Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
}

Responder .....

Jump to

Keyboard shortcuts

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