client

package
v0.0.0-...-6515ce2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

README

the client golang request to the manager, many other golang plugin can reuse this lib.

define some common struct and make http requests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func (Api) GetPluginInfo

func (this Api) GetPluginInfo(pluginName string) (Plugin, error)

func (Api) GetPluginStrategies

func (this Api) GetPluginStrategies(pluginName string) ([]Strategy, error)

func (Api) ScaleApps

func (this Api) ScaleApps(appscale []AppScale) error

type AppScale

type AppScale struct {
	App    string
	Number int
}

define the app name and scale to witch number

type Client

type Client interface {
	GetPluginInfo(pluginName string) (Plugin, error)
	GetPluginStrategies(pluginName string) ([]Strategy, error)

	/*
		[
			{
				"app":"ats",
				"num":20,
			},
			{
				"app":"hadoop",
				"num":10
			}
		]
	*/
	ScaleApps(appscale []AppScale) error
}

func NewClient

func NewClient(host, port string) Client

type Plugin

type Plugin struct {
	Name        string
	Kind        string
	Status      string
	Description string
	Spec        string
	Manual      string
}

type Strategy

type Strategy struct {
	//witch plugin strategy belongs to
	PluginName string
	Name       string
	Status     string
	Document   string
}

Jump to

Keyboard shortcuts

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