hakari

package module
v0.0.0-...-e34150a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MPL-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Hakari

Lightweight Go framework for building UI-centric desktop apps and games with HTML, CSS and JavaScript.

With love from Ukraine💙💛

Features

  • No CGo — pure Go, works everywhere Go works
  • No Node.js — no build step, no npm
  • One binary — assets embedded via go:embed
  • HTML/CSS/JS UI — write your interface like a web page
  • Multi-screen apps — each screen has its own HTML/CSS/JS
  • State preservation — screen state survives navigation
  • Reactive data binding — Go and JS share data seamlessly
  • Event system — call Go from JavaScript, update JS from Go
  • Save/load — JSON persistence in OS-standard config directory
  • Built-in DevTools — debug your UI like a web page
  • Low memory footprint — under 100 MB for typical apps
  • Asset bundling — separate CSS/JS files are inlined automatically

Status

Early development.

Requirements

  • Go 1.21+

Install

go get github.com/Muchprow/hakari

Quick start

package main

import "github.com/Muchprow/hakari"

func main() {
	app := hakari.New("My App")
	app.LoadHTMLFile("assets/index.html")
	app.Run()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(title string) *App

func (*App) Delete

func (a *App) Delete(slot string) error

func (*App) Get

func (a *App) Get(key string) any

func (*App) GoTo

func (a *App) GoTo(name string)

func (*App) GoToWith

func (a *App) GoToWith(name string, args map[string]any)

func (*App) Load

func (a *App) Load(slot string, data any) error

func (*App) LoadHTMLFile

func (a *App) LoadHTMLFile(path string) error

func (*App) LoadHTMLFromFS

func (a *App) LoadHTMLFromFS(fsys fs.FS, path string) error

func (*App) On

func (a *App) On(name string, handler any)

func (*App) OpenFile

func (a *App) OpenFile()

func (*App) Run

func (a *App) Run()

func (*App) Save

func (a *App) Save(slot string, data any) error

func (*App) SaveDir

func (a *App) SaveDir() (string, error)

func (*App) SaveExists

func (a *App) SaveExists(slot string) bool

func (*App) Screen

func (a *App) Screen(name string, fn func(s *Screen))

func (*App) Set

func (a *App) Set(key string, value any)

func (*App) Start

func (a *App) Start(name string)

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

func (*Screen) Delete

func (s *Screen) Delete(slot string) error

func (*Screen) Get

func (s *Screen) Get(key string) any

func (*Screen) GoTo

func (s *Screen) GoTo(name string)

func (*Screen) GoToWith

func (s *Screen) GoToWith(name string, args map[string]any)

func (*Screen) HTML

func (s *Screen) HTML(filePath string)

func (*Screen) Load

func (s *Screen) Load(slot string, data any) error

func (*Screen) On

func (s *Screen) On(event string, handler any)

func (*Screen) OnEnter

func (s *Screen) OnEnter(fn func())

func (*Screen) OnLeave

func (s *Screen) OnLeave(fn func())

func (*Screen) OpenFile

func (s *Screen) OpenFile()

func (*Screen) Save

func (s *Screen) Save(slot string, data any) error

func (*Screen) SaveExists

func (s *Screen) SaveExists(slot string) bool

func (*Screen) Set

func (s *Screen) Set(key string, value any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址