gokits

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

gokits

Golang development tool kits.

  • Synchronization for groups of related goroutines

go-workgroup

Third-party libs

  • pkg/errors
  • zeromicro/go-zero A cloud-native Go microservices framework with cli tool for productivity.

Reference

  • go-kit/kit is a programming toolkit for building microservices in go.
  • google/go-cloud is go cloud development kit.
  • kratos
  • asim/go-micro a distributed systems development framework.
  • tal-tech/go-zero is a web and rpc framework with lots of builtin engineering practices.
  • beego/beego is a web framework including RESTful APIs, web apps and backend services.

Documentation

Index

Constants

View Source
const Release = "v1.0.0"

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(opts ...Option) *App

func (*App) Endpoint

func (a *App) Endpoint() []string

Endpoint returns endpoints.

func (*App) ID

func (a *App) ID() string

ID returns app instance id.

func (*App) Metadata

func (a *App) Metadata() map[string]string

Metadata returns service metadata.

func (*App) Name

func (a *App) Name() string

Name returns service name.

func (*App) Version

func (a *App) Version() string

Version returns app version.

type AppInfo

type AppInfo interface {
	ID() string
	Name() string
	Version() string
	Metadata() map[string]string
	Endpoint() []string
}

AppInfo is application context value.

type Option

type Option func(o *options)

func Context

func Context(ctx context.Context) Option

func Endpoint

func Endpoint(endpoints ...*url.URL) Option

func ID

func ID(id string) Option

Set service id.

func Metadata

func Metadata(metadata map[string]string) Option

func Name

func Name(name string) Option

Set service name.

func Server

func Server(srv ...transport.Server) Option

func Signal

func Signal(sigs ...os.Signal) Option

func StopTimeout

func StopTimeout(t time.Duration) Option

func Version

func Version(version string) Option

Set service version

Directories

Path Synopsis
auth
jwt
examples
httpclient command
third_party
forked/go-workgroup
Package workgroup provides synchronization for groups of related goroutines.
Package workgroup provides synchronization for groups of related goroutines.

Jump to

Keyboard shortcuts

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