fake

package
v0.0.0-...-daa393d Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: CC-BY-SA-4.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestHandler

func RequestHandler(fakeApps []*Application, pollute bool, chain http.Handler) http.Handler

Types

type Application

type Application struct {
	ID string
	// contains filtered or unexported fields
}

A representation of a single application with multiple instances

func SingleInstanceApp

func SingleInstanceApp(appID, instanceID, IP, host string, port int) *Application

Create a single app with one instance

func SingleLocalApp

func SingleLocalApp(appID string, port int) *Application

func SingleLocalAppWithInstance

func SingleLocalAppWithInstance(appID, instanceID string, port int) *Application

func (*Application) AddInstance

func (app *Application) AddInstance(t *Target)

Add a single instance to this application.

func (*Application) AddInstances

func (app *Application) AddInstances(targets []*Target)

Add multiple instances to this application.

func (*Application) Instances

func (app *Application) Instances() []*Target

Retrieve all the instances of the application.

func (*Application) NewEurekaApp

func (app *Application) NewEurekaApp() *eureka2.Application

func (*Application) NewInstances

func (app *Application) NewInstances() []*eureka2.Instance

func (*Application) NoInstances

func (app *Application) NoInstances() bool

Check if there are any instances left in the application.

func (*Application) RemoveInstance

func (app *Application) RemoveInstance(instanceID string) (bool, *Target)

Remove a single instance from the application. Return true if the successfully removed, false otherwise.

func (*Application) String

func (app *Application) String() string

type Target

type Target struct {
	InstanceID string
	Host       string
	Port       int
	IP         string
}

A representation of a single application instance

func (*Target) String

func (t *Target) String() string

Jump to

Keyboard shortcuts

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