api

package
v0.0.0-...-398fed0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	*gin.Engine
	// contains filtered or unexported fields
}

ApiService ...

func NewAPI

func NewAPI(balancer Balancer) ApiService

NewAPI ...

func (ApiService) Serve

func (as ApiService) Serve()

type Balancer

type Balancer interface {
	GetServices() []types.Service
	AddService(*types.Service) error
	GetService(string) (*types.Service, error)
	DeleteService(string) error
	AddDestination(*types.Service, *types.Destination) error
	GetDestination(string) (*types.Destination, error)
	DeleteDestination(*types.Destination) error
	IsLeader() bool
	GetLeader() string
}

type Client

type Client struct {
	Addr       string
	HttpClient *http.Client
}

func NewClient

func NewClient(addr string) *Client

func (*Client) AddDestination

func (c *Client) AddDestination(dst types.Destination) (string, error)

func (*Client) CreateService

func (c *Client) CreateService(svc types.Service) (string, error)

func (*Client) DeleteDestination

func (c *Client) DeleteDestination(serviceId, destinationId string) error

func (*Client) DeleteService

func (c *Client) DeleteService(id string) error

func (*Client) GetService

func (c *Client) GetService(id string) (*types.Service, error)

func (*Client) GetServices

func (c *Client) GetServices() ([]*types.Service, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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