api

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen   string
	LogLevel string
}

type Driver

type Driver interface {
	KillTask(taskId string, agentId string, gradePeriod int64) error
	LaunchTasks([]*mesos.Task) error

	ClusterName() string

	SubscribeEvent(io.Writer, string) error
	FullTaskEventsAndRecords() []*types.CombinedEvents
	SendEvent(string, *types.Task) error

	ClusterAgents() map[string]*mole.ClusterAgent
	ClusterAgent(id string) *mole.ClusterAgent
	CloseClusterAgent(id string)

	// for debug convenience
	Dump() interface{}
	Load() map[string]interface{}
}

type HandlerFunc

type HandlerFunc func(w http.ResponseWriter, r *http.Request)

type Route

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

func NewPrefixRoute added in v0.2.1

func NewPrefixRoute(method, path string, handler HandlerFunc) *Route

func NewRoute

func NewRoute(method, path string, handler HandlerFunc) *Route

func (*Route) Handler

func (r *Route) Handler() HandlerFunc

func (*Route) Methods added in v0.2.1

func (r *Route) Methods() []string

func (*Route) Path

func (r *Route) Path() string

type Server

type Server struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg *Config, l net.Listener, driver Driver, db store.Store) *Server

func (*Server) GetLeader added in v0.2.1

func (s *Server) GetLeader() string

func (*Server) Reload

func (s *Server) Reload() error

func (*Server) Run

func (s *Server) Run() error

func (*Server) Shutdown

func (s *Server) Shutdown() error

gracefully shutdown.

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) UpdateLeader added in v0.2.1

func (s *Server) UpdateLeader(leader string)

Jump to

Keyboard shortcuts

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