ungo

package module
v0.0.0-...-9385bab Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 9 Imported by: 0

README

ungo

Build Status Coverage Status Go Report Card Go Doc Code Size Release

Unlock the potential of your golang development journey with UnJS - where innovation meets simplicity, and possibilities become limitless.

Usage

package main

import (
	"flag"

	"github.com/xbmlz/ungo/cfg"
	"github.com/xbmlz/ungo/server"
)

var configFile = flag.String("c", "config.yaml", "config file path")

type Config struct {
	Server server.Config
}

func main() {
	flag.Parse()

	config := &Config{}
	cfg.MustLoad(*configFile, config)

	srv := server.MustNewHTTPServer(config.Server)
	srv.Run()
}


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithID

func WithID(id string) func(application *App)

WithID application add id

func WithName

func WithName(name string) func(application *App)

WithName application add name

func WithServer

func WithServer(servers ...server.Server) func(application *App)

WithServer application add server

func WithSignals

func WithSignals(signals []os.Signal) func(application *App)

WithSignals application add listen signals

func WithVersion

func WithVersion(version string) func(application *App)

WithVersion application add version

Types

type App

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

App is the main application struct.

func NewApp

func NewApp(opts ...Option) *App

func (*App) Run

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

Run application run

func (*App) Stop

func (app *App) Stop() error

Stop application stop

type Option

type Option func(application *App)

Option is a function that can be passed to NewApp to modify the App's behavior.

Directories

Path Synopsis
unconf module

Jump to

Keyboard shortcuts

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