requestmanager

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MPL-2.0 Imports: 7 Imported by: 4

Documentation

Overview

Package requestmanager handles storage and tracking of incoming and ongoing requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestManager

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

RequestManager for use tracking CommandProcess

func NewRequestManager

func NewRequestManager() *RequestManager

NewRequestManager inits a manager for use tracking CommandProcess

func (*RequestManager) Count

func (rm *RequestManager) Count() int

Count returns total number of requests still in memory

func (*RequestManager) CreateRequest

func (rm *RequestManager) CreateRequest(reqtype int, cmd string, apicall *config.APICall, payload *gabs.Container, appID, requestKey string) *commandprocess.CommandProcess

CreateRequest makes a request and logs it in the request manager for later use Returns the created CommandProcess instance

func (*RequestManager) ExpireCompletedRequests

func (rm *RequestManager) ExpireCompletedRequests(completeResultExpiration time.Duration) []string

ExpireCompletedRequests loops through all requests that have completed and expires the request if the timeout is reached It is intended to be used as part of a go routine that loops every X seconds

func (*RequestManager) FullJSON

func (rm *RequestManager) FullJSON() (string, error)

FullJSON returns a json object in string format containing information about all current requests

func (*RequestManager) GetRequest

func (rm *RequestManager) GetRequest(id string) *commandprocess.CommandProcess

GetRequest Looks up a known request by UUID. Returns nil if not found

func (*RequestManager) RemoveRequest

func (rm *RequestManager) RemoveRequest(id string)

RemoveRequest removes a known request by UUID

func (*RequestManager) StatusJSON

func (rm *RequestManager) StatusJSON() (string, error)

StatusJSON returns a json object in string format containing id and complete status about all current requests

Jump to

Keyboard shortcuts

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