woocoo

package module
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 10 Imported by: 25

README

WooCoo

Language codecov Go Report Card Build Status Release GoDoc

Introduction

WooCoo is an application development framework and toolkit written in GO(Golang). It is easy to develop WebApi applications or RPC services.

WooCoo mainly plays a role of adhesive, and its core components are from other open source projects. The current features are as follows:

Features

  • component configurable,easy to split multi environments
  • logger and rotate support. Detail,
  • OpenTelemetry support. Detail
  • built-in web router,supports GraphQL.
  • built-in grpc server and easy to use grpc client.
  • JWT-based validation
  • microservice registry and discovery:
    • etcdv3: register and discovery services
    • Polaris: service discovery and governance

Tools

  • woco-cli: command line tool, include feature:

    • generate code support: Ent
    • server code generator for openapi 3.0 spec. seeOpenApi3 Generator

Work With

examples

woocoo examples

others:

contact:

  • QQ: 21997272

Thanks

image

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupRun added in v0.2.6

func GroupRun(ctx context.Context, timeout time.Duration, start, release func(ctx context.Context) error) (run, stop func() error)

GroupRun is a simple way to run multi goroutine with start and stop function base on simplified App.

func MiniApp added in v0.2.6

func MiniApp(ctx context.Context, timeout time.Duration, servers ...Server) (run, stop func() error)

MiniApp is a simple way to run multi goroutine base on simplified App.

Types

type App

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

App is the application with a universal mechanism to manage goroutine lifecycles.

func New

func New(opts ...Option) *App

New creates an application by Option.

func (*App) AppConfiguration

func (a *App) AppConfiguration() *conf.AppConfiguration

func (*App) RegisterServer

func (a *App) RegisterServer(servers ...Server)

func (*App) Run

func (a *App) Run() error

Run all Server concurrently. Run returns when all Server have exited. Run returns the first non-nil error (if any) from them.

func (*App) Stop

func (a *App) Stop() error

Stop the application.

type Option

type Option func(o *options)

func WithAppConfiguration

func WithAppConfiguration(cnf *conf.Configuration) Option

WithAppConfiguration set up the configuration of the web server by a configuration instance

type Server

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

Server is the interface that can run in App.

Directories

Path Synopsis
cmd
woco Module
contrib
etcd Module
gql Module
opentelemetry Module
polarismesh Module
telemetry Module
examples
hello-web Module
pkg
cnp
Package cnp includes concurrence and parallel tools
Package cnp includes concurrence and parallel tools
gds
gds/timeinterval
Package timeinterval is time range data structure ,many trade system has this.
Package timeinterval is time range data structure ,many trade system has this.
log
rpc
test
web

Jump to

Keyboard shortcuts

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