registration

package
v0.2.0-demo Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApplicationRegistryClient

func NewApplicationRegistryClient(b PayloadBuilder, retryTime int, retries int) applicationRegistryClient

NewApplicationRegistryClient creates a applicationRegistryClient instance with the passed in interface

func NewFileReader

func NewFileReader() fileReader

NewFileReader creates new fileReader struct

func NewPayloadBuilder

func NewPayloadBuilder(fr FileReader, appName string) payloadBuilder

NewPayloadBuilder creates a serviceDetailsPayloadBuilder instance

Types

type API

type API struct {
	TargetURL        string          `json:"targetUrl"`
	Credentials      *Credentials    `json:"credentials,omitempty"`
	Spec             json.RawMessage `json:"spec,omitempty"`
	SpecificationURL string          `json:"specificationUrl,omitempty"`
	ApiType          string          `json:"apiType"`
}

type ApplicationRegistryClient

type ApplicationRegistryClient interface {
	RegisterService() (string, apperrors.AppError)
}

ApplicationRegistryClient is an interface containing all necessary functions required to register service in Kyma's application registry

type Basic

type Basic struct {
	Username string    `json:"username"`
	Password string    `json:"password"`
	CSRFInfo *CSRFInfo `json:"csrfInfo,omitempty"`
}

type CSRFInfo

type CSRFInfo struct {
	TokenEndpointURL string `json:"tokenEndpointURL"`
}

type CertificateGen

type CertificateGen struct {
	CommonName  string    `json:"commonName"`
	Certificate string    `json:"certificate"`
	CSRFInfo    *CSRFInfo `json:"csrfInfo,omitempty"`
}

type Credentials

type Credentials struct {
	Oauth          *Oauth          `json:"oauth,omitempty"`
	Basic          *Basic          `json:"basic,omitempty"`
	CertificateGen *CertificateGen `json:"certificateGen,omitempty"`
}

type DocsObject

type DocsObject struct {
	Title  string `json:"title"`
	Type   string `json:"type"`
	Source string `json:"source"`
}

type Documentation

type Documentation struct {
	DisplayName string       `json:"displayName"`
	Description string       `json:"description"`
	Type        string       `json:"type"`
	Tags        []string     `json:"tags,omitempty"`
	Docs        []DocsObject `json:"docs,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}

type Events

type Events struct {
	Spec json.RawMessage `json:"spec,omitempty"`
}

type FileReader

type FileReader interface {
	Read(string) ([]byte, error)
}

FileReader is an interface used to allow mocking file reading

type Oauth

type Oauth struct {
	URL          string    `json:"url"`
	ClientID     string    `json:"clientId"`
	ClientSecret string    `json:"clientSecret"`
	CSRFInfo     *CSRFInfo `json:"csrfInfo,omitempty"`
}

type PayloadBuilder

type PayloadBuilder interface {
	Build() (ServiceDetails, error)
	GetApplicationRegistryURL() string
}

PayloadBuilder is an interface containing all necessary functions required to build an ServiceDetails structure

type PostServiceResponse

type PostServiceResponse struct {
	ID string `json:"id"`
}

type RegisterResponse

type RegisterResponse struct {
	ID string
}

RegisterResponse contain structure of response json

type ServiceDetails

type ServiceDetails struct {
	Provider         string            `json:"provider"`
	Name             string            `json:"name"`
	Description      string            `json:"description"`
	ShortDescription string            `json:"shortDescription,omitempty"`
	Identifier       string            `json:"identifier,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
	API              *API              `json:"api,omitempty"`
	Events           *Events           `json:"events,omitempty"`
	Documentation    *Documentation    `json:"documentation,omitempty"`
}

ServiceDetails - main structure of content required to register service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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