api

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package api implements the replicant API handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAllRoutes

func AddAllRoutes(prefix string, server *server.Server)

AddAllRoutes api routes to the given server with the given prefix. The prefix can be empty.

func AddDebugRoutes

func AddDebugRoutes(server *server.Server)

AddDebugRoutes add routes for serving runtime profiling data Add all handlers from net/http/pprof and all profiles from pprof.Profiles().

func AddTransaction

func AddTransaction(srv *server.Server) (handle server.Handler)

AddTransaction to the replicant manager

func CallbackRequest added in v0.2.0

func CallbackRequest(srv *server.Server) (handle server.Handler)

CallbackRequest services callback requests for transactions being run from executors

func GetResult

func GetResult(srv *server.Server) (handle server.Handler)

GetResult of managed replicant transactions by name

func GetResults

func GetResults(srv *server.Server) (handle server.Handler)

GetResults of all managed replicant transactions

func GetTransaction

func GetTransaction(srv *server.Server) (handle server.Handler)

GetTransaction fetches a named transaction definition from the replicant manager

func GetTransactions

func GetTransactions(srv *server.Server) (handle server.Handler)

GetTransactions fetches all transaction definition from the replicant manager

func RemoveTransaction

func RemoveTransaction(srv *server.Server) (handle server.Handler)

RemoveTransaction removes a named transaction from the replicant manager

func RunTransaction

func RunTransaction(srv *server.Server) (handle server.Handler)

RunTransaction runs a unmanaged ad-hoc transaction

func RunTransactionByName

func RunTransactionByName(srv *server.Server) (handle server.Handler)

RunTransactionByName runs a managed ad-hoc transaction

Types

type Result

type Result struct {
	Error   string      `json:"error,omitempty"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

Result is the api calls result envelope

Jump to

Keyboard shortcuts

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