api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2017 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

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

APIServer body structure

func NewAPIServer

func NewAPIServer(ip string, port int,
	tokens map[string]string, tls bool, pair *KayPair, backend ApiController) (*APIServer, error)

NewAPIServer initialize APIServer

func (*APIServer) Run

func (a *APIServer) Run()

Run APIServer

func (*APIServer) Stop

func (a *APIServer) Stop(wait time.Duration) error

Stop APIServer

type ApiController

type ApiController interface {
	ListRegions() ([]string, error)
	ListNode(*pb.Node, *pb.Search) ([]*pb.Node, int32, error)
	AddJob(*pb.Job) (*pb.Job, error)
	ModifyJob(*pb.Job) (*pb.Job, error)
	DeleteJob(*pb.Job) (*pb.Job, error)
	ListJob(in *pb.Job, search *pb.Search) ([]*pb.Job, int32, error)
	RunJob(name, region string) (*pb.Execution, error)
	GetStatus(name, region string) (*pb.JobStatus, error)
	ListExecutions(in *pb.Execution, search *pb.Search) ([]*pb.Execution, int32, error)
	Search(interface{}, *pb.Search) ([]interface{}, int32, error)
}

ApiController is interface used to operate all objs

type KayPair

type KayPair struct {
	Key  string
	Cert string
}

KayPair tls cert key pair

Jump to

Keyboard shortcuts

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