systemfetcher

package
v0.0.0-...-0640eb1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LifecycleAttributeName missing godoc
	LifecycleAttributeName string = "lifecycleStatus"
	// LifecycleDeleted missing godoc
	LifecycleDeleted string = "DELETED"

	// ConcurrentDeleteOperationErrMsg missing godoc
	ConcurrentDeleteOperationErrMsg = "Concurrent operation [reason=delete operation is in progress]"
)

Variables

View Source
var (
	// Mappings global static configuration which is set after reading the configuration during startup, should only be used for the unmarshaling of system data
	// Template mappings describe what properties and their values should be in order to map to a certain application template ID
	// If there are multiple keys and values, all of them should match in order for the mapping to be successful
	Mappings []TemplateMapping
)

Functions

func DefaultClientCreator

func DefaultClientCreator(ctx context.Context, oAuth2Config OAuth2Config) *http.Client

DefaultClientCreator missing godoc

Types

type APIConfig

type APIConfig struct {
	Endpoint                    string        `envconfig:"APP_SYSTEM_INFORMATION_ENDPOINT"`
	FilterCriteria              string        `envconfig:"APP_SYSTEM_INFORMATION_FILTER_CRITERIA"`
	FilterTenantCriteriaPattern string        `envconfig:"APP_SYSTEM_INFORMATION_FILTER_TENANT_CRITERIA_PATTERN"`
	Timeout                     time.Duration `envconfig:"APP_SYSTEM_INFORMATION_FETCH_TIMEOUT"`
	PageSize                    uint64        `envconfig:"APP_SYSTEM_INFORMATION_PAGE_SIZE"`
	PagingSkipParam             string        `envconfig:"APP_SYSTEM_INFORMATION_PAGE_SKIP_PARAM"`
	PagingSizeParam             string        `envconfig:"APP_SYSTEM_INFORMATION_PAGE_SIZE_PARAM"`
}

APIConfig missing godoc

type AdditionalAttributes

type AdditionalAttributes map[string]string

AdditionalAttributes missing godoc

type AdditionalURLs

type AdditionalURLs map[string]string

AdditionalURLs missing godoc

type Authenticator

type Authenticator interface {
	GetAuthorization(ctx context.Context) (string, error)
}

Authenticator missing godoc

type Client

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

Client missing godoc

func NewClient

func NewClient(apiConfig APIConfig, oAuth2Config OAuth2Config, clientCreator clientCreatorFunc) *Client

NewClient missing godoc

func (*Client) FetchSystemsForTenant

func (c *Client) FetchSystemsForTenant(ctx context.Context, tenant string) ([]System, error)

FetchSystemsForTenant fetches systems from the service by making 2 HTTP calls with different filter criteria

type Config

type Config struct {
	SystemsQueueSize          int           `envconfig:"default=100,APP_SYSTEM_INFORMATION_QUEUE_SIZE"`
	FetcherParallellism       int           `envconfig:"default=30,APP_SYSTEM_INFORMATION_PARALLELLISM"`
	DirectorGraphqlURL        string        `envconfig:"APP_DIRECTOR_GRAPHQL_URL"`
	DirectorRequestTimeout    time.Duration `envconfig:"default=30s,APP_DIRECTOR_REQUEST_TIMEOUT"`
	DirectorSkipSSLValidation bool          `envconfig:"default=false,APP_DIRECTOR_SKIP_SSL_VALIDATION"`

	EnableSystemDeletion bool `envconfig:"default=true,APP_ENABLE_SYSTEM_DELETION"`
}

Config missing godoc

type DirectorClient

type DirectorClient interface {
	DeleteSystemAsync(ctx context.Context, id, tenant string) error
}

DirectorClient missing godoc

type DirectorGraphClient

type DirectorGraphClient struct {
	*gcli.Client
	Authenticator Authenticator
}

DirectorGraphClient missing godoc

func (*DirectorGraphClient) DeleteSystemAsync

func (d *DirectorGraphClient) DeleteSystemAsync(ctx context.Context, id, tenantID string) error

DeleteSystemAsync missing godoc

type HeaderTransport

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

HeaderTransport missing godoc

func (*HeaderTransport) RoundTrip

func (ht *HeaderTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip missing godoc

type OAuth2Config

type OAuth2Config struct {
	ClientID             string   `envconfig:"APP_OAUTH_CLIENT_ID"`
	ClientSecret         string   `envconfig:"APP_OAUTH_CLIENT_SECRET"`
	TokenEndpointPattern string   `envconfig:"APP_OAUTH_TOKEN_ENDPOINT_PATTERN"`
	TenantHeaderName     string   `envconfig:"APP_OAUTH_TENANT_HEADER_NAME"`
	ScopesClaim          []string `envconfig:"APP_OAUTH_SCOPES_CLAIM"`
}

OAuth2Config missing godoc

type System

type System struct {
	SystemBase
	TemplateID string `json:"-"`
}

System missing godoc

func (*System) UnmarshalJSON

func (s *System) UnmarshalJSON(data []byte) error

UnmarshalJSON missing godoc

type SystemBase

type SystemBase struct {
	SystemNumber           string               `json:"systemNumber"`
	DisplayName            string               `json:"displayName"`
	ProductDescription     string               `json:"productDescription"`
	BaseURL                string               `json:"baseUrl"`
	InfrastructureProvider string               `json:"infrastructureProvider"`
	AdditionalURLs         AdditionalURLs       `json:"additionalUrls"`
	AdditionalAttributes   AdditionalAttributes `json:"additionalAttributes"`
}

SystemBase missing godoc

type SystemFetcher

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

SystemFetcher missing godoc

func NewSystemFetcher

func NewSystemFetcher(tx persistence.Transactioner, ts TenantService, ss SystemsService, sac SystemsAPIClient, directorClient DirectorClient, config Config) *SystemFetcher

NewSystemFetcher missing godoc

func (*SystemFetcher) SyncSystems

func (s *SystemFetcher) SyncSystems(ctx context.Context) error

SyncSystems missing godoc

type SystemsAPIClient

type SystemsAPIClient interface {
	FetchSystemsForTenant(ctx context.Context, tenant string) ([]System, error)
}

SystemsAPIClient missing godoc

type SystemsService

type SystemsService interface {
	CreateManyIfNotExistsWithEventualTemplate(ctx context.Context, applicationInputs []model.ApplicationRegisterInputWithTemplate) error
	GetByNameAndSystemNumber(ctx context.Context, name, systemNumber string) (*model.Application, error)
}

SystemsService missing godoc

type TemplateMapping

type TemplateMapping struct {
	Name        string
	ID          string
	SourceKey   []string
	SourceValue []string
}

TemplateMapping missing godoc

type TenantService

type TenantService interface {
	List(ctx context.Context) ([]*model.BusinessTenantMapping, error)
	GetInternalTenant(ctx context.Context, externalTenant string) (string, error)
}

TenantService missing godoc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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