Documentation
¶
Overview ¶
Package happy provides a modular framework for rapid prototyping in Go. With this SDK, developers of all levels can easily bring their ideas to life. Whether you're a hacker or a creator, Package happy has everything you need to tackle your domain problems and create working prototypes or MVPs with minimal technical knowledge and infrastructure planning.
Its modular design enables you to package your commands and services into reusable addons, so you're not locked into any vendor tools. It also fits well into projects where different components are written in different programming languages.
Let Package happy help you bring your projects from concept to reality and make you happy along the way.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
Example ¶
package main
import (
"fmt"
"github.com/happy-sdk/happy"
"github.com/happy-sdk/happy/sdk/action"
"github.com/happy-sdk/happy/sdk/app/session"
"github.com/happy-sdk/happy/sdk/logging"
)
func main() {
app := happy.New(happy.Settings{})
// Create a new test logger
log := logging.NewTestLogger(logging.LevelError)
app.WithLogger(log)
app.Do(func(sess *session.Context, args action.Args) error {
sess.Log().Println("Hello, world!")
return nil
})
app.Run()
fmt.Println(log.Output())
}
Output: {"level":"out","msg":"Hello, world!"}
Types ¶
type Settings ¶ added in v0.11.0
type Settings struct {
// Appication info
Name settings.String `key:"app.name" default:"Happy Prototype" desc:"Application name"`
Slug settings.String `key:"app.slug" default:"" desc:"Application slug"`
Identifier settings.String `key:"app.identifier" desc:"Application identifier"`
Description settings.String `` /* 156-byte string literal not displayed */
CopyrightBy settings.String `key:"app.copyright_by" default:"Anonymous" desc:"Application author"`
CopyrightSince settings.Uint `key:"app.copyright_since" default:"0" desc:"Application copyright since"`
License settings.String `key:"app.license" default:"NOASSERTION" desc:"Application license"`
// Application settings
Engine engine.Settings `key:"app.engine"`
CLI cli.Settings `key:"app.cli"`
Config config.Settings `key:"app.config"`
DateTime datetime.Settings `key:"app.datetime"`
Instance instance.Settings `key:"app.instance"`
Logging logging.Settings `key:"app.logging"`
Services services.Settings `key:"app.services"`
Stats stats.Settings `key:"app.stats"`
Devel devel.Settings `key:"app.devel"`
// contains filtered or unexported fields
}
Directories
¶
| Path | Synopsis |
|---|---|
|
addons
|
|
|
third-party/github
module
|
|
|
cmd
|
|
|
hap
module
|
|
|
internal
|
|
|
cmd/hap
module
|
|
|
pkg
|
|
|
bitutils
module
|
|
|
branding
module
|
|
|
bytesize
module
|
|
|
cli/ansicolor
module
|
|
|
devel/goutils
module
|
|
|
devel/testutils
module
|
|
|
fsutils
module
|
|
|
i18n
module
|
|
|
logging
module
|
|
|
logging/adapters/console
module
|
|
|
networking
module
|
|
|
options
module
|
|
|
platform/daemon
module
|
|
|
scheduling/cron
module
|
|
|
settings
module
|
|
|
strings/bexp
module
|
|
|
strings/humanize
module
|
|
|
strings/slug
module
|
|
|
strings/textfmt
module
|
|
|
tui
module
|
|
|
vars
module
|
|
|
version
module
|
|
|
sdk
|
|
|
cli
Package cli provides utilities for happy command line interfaces.
|
Package cli provides utilities for happy command line interfaces. |
|
networking/address
Package address provides functions for working with "happy" addresses, which are URL-like strings that define the location of a resource in the "happy" system.
|
Package address provides functions for working with "happy" addresses, which are URL-like strings that define the location of a resource in the "happy" system. |
|
internal/cmd/hsdk
module
|