cups

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 4 Imported by: 0

README

CUPS Eureka client

This connector supports a user defined Eureka service in Cloudfoundry. Defining such a service in Cloudfoundry:

cf cups -p '{"uri":"https://eureka-service-url"}' -t eureka eureka-service

The connector uses the tag to discover the service. It returns an instance of the Go Eureka client

Example

import (
    "github.com/cloudfoundry-community/gautocloud"
    "github.com/philips-software/gautocloud-connectors/cups"
    "github.com/loafoe/go-eureka-client/eureka"
)
    var client *eureka.Client

    err := gautocloud.Inject(&client)
    if err != nil {
        panic(err)
    }
    instance := eureka.NewInstanceInfo("my-service.foo.com", "my-service", "10.0.0.1", 443, 30, true) //Create a new instance to register
    err := client.RegisterInstance("my-service", instance) // Register new instance in your eureka(s)
    if err != nil {
        fmt.Printf("Error registering: %v\n", err)
    }
    applications, _ := client.GetApplications() // Retrieves all applications from eureka server(s)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEurekaConnector

func NewEurekaConnector() connectors.Connector

func NewEurekaFargoConnector

func NewEurekaFargoConnector() connectors.Connector

Types

type EurekaConnector

type EurekaConnector struct{}

func (EurekaConnector) Id

func (c EurekaConnector) Id() string

func (EurekaConnector) Load

func (c EurekaConnector) Load(schema interface{}) (interface{}, error)

func (EurekaConnector) Name

func (c EurekaConnector) Name() string

func (EurekaConnector) Schema

func (c EurekaConnector) Schema() interface{}

func (EurekaConnector) Tags

func (c EurekaConnector) Tags() []string

type EurekaFargoConnector

type EurekaFargoConnector struct{}

func (EurekaFargoConnector) Id

func (EurekaFargoConnector) Load

func (c EurekaFargoConnector) Load(schema interface{}) (interface{}, error)

func (EurekaFargoConnector) Name

func (c EurekaFargoConnector) Name() string

func (EurekaFargoConnector) Schema

func (c EurekaFargoConnector) Schema() interface{}

func (EurekaFargoConnector) Tags

func (c EurekaFargoConnector) Tags() []string

type EurekaFargoSchema

type EurekaFargoSchema struct {
	URI string `cloud:"uri"`
}

type EurekaSchema

type EurekaSchema struct {
	URI string `cloud:"uri"`
}

Jump to

Keyboard shortcuts

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