An open API service indexing awesome lists of open source software.

https://github.com/candango/uiok

UI toolkit implements HATEOAS
https://github.com/candango/uiok

Last synced: 5 months ago
JSON representation

UI toolkit implements HATEOAS

Awesome Lists containing this project

README

          

# candango/uiok

**uiok** is a Go framework for building RESTful APIs that fully embrace the
HATEOAS principle ("Hypermedia As The Engine Of Application State").
It provides abstractions for defining resources, generating hypermedia controls
(links and actions), and constructing dynamic, discoverable API responses.

## Features

- **Component-based**: Define reusable units of UI logic and rendering.
- **Composite support**: Nest and aggregate components for complex UIs.
- **Validation abstraction**: Integrate form and input validation logic cleanly.
- **HTTP compatibility**: Bind component data directly from HTTP forms.

## Getting Started

TODO

## Usage

A basic usage example can be found in the [`examples/`](examples/) folder.
Here’s a minimal example:

```go
package main

import (
"os"
"context"
"github.com/candango/uiok/uiok"
)

type HelloComponent struct {}

func (h *HelloComponent) Partial() ([]byte, error) { return []byte("

Hello, world!

"), nil }
func (h *HelloComponent) Render() ([]byte, error) { return h.Partial() }
func (h *HelloComponent) Change(ctx context.Context) error { return nil }

func main() {
c := &HelloComponent{}
_ = uiok.Write(os.Stdout, c)
}
```

## Contributing

Issues and pull requests are welcome! Please see our [contributing
guidelines](CONTRIBUTING.md) for details.

## License

[MIT License](LICENSE)

---