api

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2018 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStartFailed = errors.New("failed to start API")

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(host string, port string) *Api

func (*Api) Connect

func (a *Api) Connect(path string, header http.Header) (ws *mock.WebsocketClient)

func (*Api) ConnectAgent

func (a *Api) ConnectAgent(path string, header http.Header, configs ...proto.AgentConfig) (ws *mock.WebsocketClient)

func (*Api) Delete

func (a *Api) Delete(path string, header http.Header) (*http.Response, []byte, error)

func (*Api) DisconnectAllClients

func (a *Api) DisconnectAllClients()

func (*Api) Get

func (a *Api) Get(path string, header http.Header) (*http.Response, []byte, error)

func (*Api) GetHost

func (a *Api) GetHost() string

func (*Api) GetPort

func (a *Api) GetPort() string

func (*Api) Post

func (a *Api) Post(path string, header http.Header, data []byte) (*http.Response, []byte, error)

func (*Api) Put

func (a *Api) Put(path string, header http.Header, data []byte) (*http.Response, []byte, error)

func (*Api) Start

func (a *Api) Start() (err error)

func (*Api) StartPost

func (a *Api) StartPost(path string, header http.Header, data []byte) chan Response

func (*Api) StartPut

func (a *Api) StartPut(path string, header http.Header, data []byte) chan Response

func (*Api) Stop

func (a *Api) Stop()

type ApiService

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

func NewApiService

func NewApiService() *ApiService

func (*ApiService) DisconnectAllClients

func (a *ApiService) DisconnectAllClients()

func (*ApiService) GetApi

func (a *ApiService) GetApi(host string, port string) *Api

func (*ApiService) StopAllApi

func (a *ApiService) StopAllApi()

func (*ApiService) StopApi

func (a *ApiService) StopApi(host string, port string)

type Response

type Response struct {
	Resp    *http.Response
	Content []byte
	Err     error
}

Jump to

Keyboard shortcuts

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