![]() * externalize interface compatibility for two optional template engines Templ and GoStar are currently module dependencies for Golang SDK. They should not be required for 1.0 release. This step replaces two component interfaces with copies that ensure compatibility without having to include various optional engines as dependencies with each Datastar deployment. * update comments and documentation for Golang SDK Added comments to `execute.go` file. I will make similar changes to other files. I submit those as a way of getting feedback. The only public API change is the removal of execute script options struct. It is changed to private by letter case because the options pattern is used to configure script execution. The struct serves no purpose and pollutes the public API. * add hot reload example to Golang SDK Updated the Golang SDK README.md file to include a list of examples that will be expanded in the future. A basic example is moved into its own directory. A hot reload example is added alongside it. * expand Golang SDK documentation by adding comments to every method Added a comment to every public method. Removed inaccessible options structs from public API by letter case change. Exposed one hidden option to public API. Refactored fragment merge mode parsing and added a matching validation test. * reinstate ValidFragmentMergeTypes because the website documentation depends on it |
||
---|---|---|
.. | ||
examples | ||
.gitattributes | ||
README.md | ||
consts.go | ||
execute-script-sugar.go | ||
execute.go | ||
fragments-sugar.go | ||
fragments.go | ||
fragments_test.go | ||
signals-sugar.go | ||
signals.go | ||
sse-compression.go | ||
sse.go | ||
types.go |
README.md
Go SDK for Datastar
Implements the SDK spec and exposes an abstract ServerSentEventGenerator struct that can be used to implement runtime specific classes.
Installation
go get -u github.com/starfederation/datastar/sdk/go
Examples
- Basic Usage
- Hot Reload
- The Datastar website also acts as a set of examples for how to use the SDK.