Documentation
¶
Overview ¶
Json i/o Json in: execute & decode http requests Json out: handle & encode http responses, server-side streaming
Index ¶
- func Node(ctx context.Context) (*rpc.Client, *ethclient.Client, error)
- type Data
- type JSON
- func (j *JSON) In(url, apiKey string) ([]byte, error)
- func (j *JSON) Out(w http.ResponseWriter, input func() (any, error), locker sync.Locker)
- func (j *JSON) OutSSE(w http.ResponseWriter, r *http.Request, input func() (any, error), ...)
- func (j *JSON) Print(value any)
- func (j *JSON) Simplify(input []any, prefix string) []any
- type Math
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶ added in v1.1.25
func (*Data) ConnectPostgres ¶ added in v1.1.25
type JSON ¶
func Json ¶
Json initializes and returns a new JSON utility instance, using http.Client and context.Context created in NewFactory.
func (*JSON) In ¶
Execute HTTP GET requests, with X-API-KEY headers as needed, and return the response body as bytes.
func (*JSON) Out ¶
Out writes single response for http requests, using a function to source data and a locker to synchronize access or an HTTP 500 error when the input function fails or JSON encoding fails.
func (*JSON) OutSSE ¶
func (j *JSON) OutSSE(w http.ResponseWriter, r *http.Request, input func() (any, error), interval time.Duration)
OutSSE is Out at a defined interval, streams responses until the client disconnects or the context is canceled.
type State ¶ added in v1.1.23
func (*State) AddToPackage ¶ added in v1.1.33
func (*State) GetFromPackage ¶ added in v1.1.33
func (*State) GetPackage ¶ added in v1.1.33
Click to show internal directories.
Click to hide internal directories.