Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.0% on proxy.golang.org
Top 4.6% dependent packages on proxy.golang.org

proxy.golang.org : github.com/fogfish/gurl

Package gurl is a class of High Order Component which can do http requests with few interesting property such as composition and laziness. The library implements rough and naive Haskell's equivalent of do-notation, so called monadic binding form. This construction decorates http i/o pipeline(s) with "programmable commas". Microservices have become a design style to evolve system architecture in parallel, implement stable and consistent interfaces. An expressive language is required to design the variety of network communication use-cases. A pure functional languages fits very well to express communication behavior. The language gives a rich techniques to hide the networking complexity using monads as abstraction. The IO-monads helps us to compose a chain of network operations and represent them as pure computation, build a new things from small reusable elements. The library is implemented after Erlang's https://github.com/fogfish/m_http The library attempts to adapts a human-friendly syntax of HTTP request/response logging/definition used by curl with Behavior as a Code paradigm. It tries to connect cause-and-effect (Given/When/Then) with the networking (Input/Process/Output). This semantic provides an intuitive approach to specify HTTP requests/responses. Adoption of this syntax as Go native code provides a rich capability to network programming. ↣ cause-and-effect abstraction of HTTP request/response, naive do-notation ↣ high-order composition of individual HTTP requests to complex networking computations ↣ human-friendly, Go native and declarative syntax to depict HTTP operations ↣ implements a declarative approach for testing of RESTful interfaces ↣ automatically encodes/decodes Go native HTTP payload using Content-Type hints ↣ supports generic transformation to algebraic data types ↣ simplify error handling with naive Either implementation Standard Golang packages implements low-level HTTP interface, which requires knowledge about protocol itself, aspects of Golang implementation, a bit of boilerplate coding and lack of standardized chaining (composition) of individual requests. gurl library inherits an ability of pure functional languages to express communication behavior by hiding the networking complexity using category pattern (aka "do"-notation). This pattern helps us to compose a chain of network operations and represent them as pure computation, build a new things from small reusable elements. This library uses the "do"-notation, so called monadic binding form. It is well know in functional programming languages such as Haskell and Scala. The networking becomes a collection of composed "do"-notation in context of a state monad. A composition of HTTP primitives within the category are written with the following syntax. Here, each arrow is a morphism applied to HTTP protocol. The implementation defines an abstraction of the protocol environments and lenses to focus inside it. In other words, the category represents the environment as an "invisible" side-effect of the composition. `gurl.Join(arrows ...Arrow) Arrow` and its composition implements lazy I/O. It only returns a "promise", you have to evaluate it in the context of IO instance. The following code snippet demonstrates a typical usage scenario. The evaluation of "program" fails if either networking fails or expectations do not match actual response. There are no needs to check error code after each operation. The composition is smart enough to terminate "program" execution. See User Guide about the library at https://github.com/fogfish/gurl

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/fogfish/gurl
Keywords: declarative-programming, declarative-workflows, golang, higher-order-functions, http-client, http-monad, monadic-interface, networking, url
License: MIT
Latest release: over 1 year ago
First release: about 3 years ago
Namespace: github.com/fogfish
Dependent packages: 1
Stars: 4 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 18 hours ago

    Loading...
    Readme
    Loading...