datastar/sdk/go
Dmitry Kotik b758fb3e06
Expand Golang SDK documentation by adding comments to every method. (#838)
* 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
2025-04-14 10:40:01 -06:00
..
examples Add hot reload example to Golang SDK (#834) 2025-04-12 08:29:05 -06:00
.gitattributes v0.21.0-beta1 2024-12-05 09:09:04 -08:00
README.md Add hot reload example to Golang SDK (#834) 2025-04-12 08:29:05 -06:00
consts.go Add wildcard support to persist plugin (#807) 2025-03-30 10:58:39 -06:00
execute-script-sugar.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
execute.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
fragments-sugar.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
fragments.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
fragments_test.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
signals-sugar.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
signals.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
sse-compression.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
sse.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00
types.go Expand Golang SDK documentation by adding comments to every method. (#838) 2025-04-14 10:40:01 -06:00

README.md

Go SDK for Datastar

Go Reference

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