gocherry

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: GPL-3.0 Imports: 19 Imported by: 1

README

gocherry

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildDate string = unset
	GitBranch string = unset
	GitCommit string = unset
	GoVersion string = unset
	GitTag    string = unset
)

Build flags variables

View Source
var (
	ErrSuccessExit = errors.New("success and exit with code 0")
)

Functions

func AppFlags added in v0.0.4

func AppFlags(writer io.Writer) func(*flagset)

func BuildInfoJson added in v0.0.4

func BuildInfoJson(writer io.Writer)

func BuildInfoYaml added in v0.0.4

func BuildInfoYaml(writer io.Writer)

func ConfigFlags added in v0.0.2

func ConfigFlags(writer io.Writer, structs ...any) func(*flagset)

func FlagConfigGenEnv added in v0.0.4

func FlagConfigGenEnv(structs ...any) func(string) error

func FlagConfigInfoEnv added in v0.0.4

func FlagConfigInfoEnv(writer io.Writer, structs ...any) func(string) error

func Flags added in v0.0.4

func Flags(writer io.Writer, args []string, flagsets ...func(*flagset))

Types

type App

type App struct {
	Log *slog.Logger
	// contains filtered or unexported fields
}

func NewApp

func NewApp(opts ...AppOption) (*App, error)

func (*App) AddServices

func (app *App) AddServices(services ...any)

func (*App) Start

func (app *App) Start(ctx context.Context) error

func (*App) Stop

func (app *App) Stop(ctx context.Context)

type AppOption

type AppOption = func(*App)

func WithHttpRoutes

func WithHttpRoutes(handler http.Handler) AppOption

func WithWorkerPool

func WithWorkerPool(subscriptions ...chan PoolTask) AppOption

type BuildInfo added in v0.0.4

type BuildInfo struct {
	BuildDate string `json:"build_date,omitempty" yaml:"build_date,omitempty"`
	GitBranch string `json:"git_branch,omitempty" yaml:"git_branch,omitempty"`
	GitCommit string `json:"git_commit,omitempty" yaml:"git_commit,omitempty"`
	GoVersion string `json:"go_version,omitempty" yaml:"go_version,omitempty"`
	GitTag    string `json:"git_tag,omitempty" yaml:"git_tag,omitempty"`
}

type Closer added in v0.0.2

type Closer interface {
	Close(ctx context.Context) error
}

type Pool

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

func NewPool

func NewPool(subscriptions ...chan PoolTask) (*Pool, error)

func NewPoolContext

func NewPoolContext(ctx context.Context, subscriptions ...chan PoolTask) (*Pool, error)

func (*Pool) Start

func (p *Pool) Start(ctx context.Context) error

func (*Pool) Stop

func (p *Pool) Stop(ctx context.Context) error

type PoolTask

type PoolTask struct {
	ID       string
	Func     func()
	Priority int
}

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Directories

Path Synopsis
pkg
api
bot
package bot contains
package bot contains
colors
The colors package provides text highlighting functionality through the Higlighter struct, which can highlight numbers and keywords in strings using configurable color codes.
The colors package provides text highlighting functionality through the Higlighter struct, which can highlight numbers and keywords in strings using configurable color codes.
sql

Jump to

Keyboard shortcuts

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