Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleRequest ¶
func HandleRequest[Res any, Req Request[Res]](ctx context.Context, handler RequestHandler[Res, Req]) func(*nats.Msg)
HandleRequest returns a NATS subscription target that calls the provided request handler in a new goroutine if the NATS message payload can be parsed into the specified request type, and responds to the client appropriately.
func UnmarshalResponse ¶
UnmarshalResponse parses a response received from the job server, either into a result of the specified type, or as an error; depending on the response's structure.
Types ¶
type Cache ¶
type Cache[V any] struct { // contains filtered or unexported fields }
type CacheStats ¶
type CacheStats struct {
// contains filtered or unexported fields
}
func (*CacheStats) Count ¶
func (c *CacheStats) Count() uint64
Count returns the total count of cache accesses.
func (*CacheStats) Hits ¶
func (c *CacheStats) Hits() uint64
Hits returns the count of cache accesses that resulted in a hit.
func (*CacheStats) RecordMiss ¶
func (c *CacheStats) RecordMiss()
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph keeps track of a directed acyclic graph.
func (*Graph) AddEdge ¶
AddEdge adds a new edge to this graph. Returns an error if the new edge would introduce a cycle in the graph.
func (*Graph) RemoveEdge ¶
RemoveEdge removes an edge from this graph.