Documentation ¶
Overview ¶
Package requestmanager handles storage and tracking of incoming and ongoing requests
Index ¶
- type RequestManager
- func (rm *RequestManager) Count() int
- func (rm *RequestManager) CreateRequest(reqtype int, cmd string, apicall *config.APICall, payload *gabs.Container, ...) *commandprocess.CommandProcess
- func (rm *RequestManager) ExpireCompletedRequests(completeResultExpiration time.Duration) []string
- func (rm *RequestManager) FullJSON() (string, error)
- func (rm *RequestManager) GetRequest(id string) *commandprocess.CommandProcess
- func (rm *RequestManager) RemoveRequest(id string)
- func (rm *RequestManager) StatusJSON() (string, error)
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