Documentation ¶
Index ¶
- func Handle(h interface{}, opts ...server.HandlerOption) error
- func Run()
- func Subscribe(topic string, h interface{}, opts ...server.SubscriberOption) error
- type Event
- type Option
- func Address(addr string) Option
- func AfterStart(fn func() error) Option
- func AfterStop(fn func() error) Option
- func BeforeStart(fn func() error) Option
- func BeforeStop(fn func() error) Option
- func HandleSignal(b bool) Option
- func Metadata(md map[string]string) Option
- func Name(n string) Option
- func RegisterInterval(t time.Duration) Option
- func RegisterTTL(t time.Duration) Option
- func Version(v string) Option
- func WrapCall(w ...client.CallWrapper) Option
- func WrapClient(w ...client.Wrapper) Option
- func WrapHandler(w ...server.HandlerWrapper) Option
- func WrapSubscriber(w ...server.SubscriberWrapper) Option
- type Options
- type Service
- func (s *Service) Client() client.Client
- func (s *Service) Handle(v interface{}) error
- func (s *Service) Init(opts ...Option)
- func (s *Service) Model() model.Model
- func (s *Service) Name() string
- func (s *Service) Options() Options
- func (s *Service) Run() error
- func (s *Service) Server() server.Server
- func (s *Service) Start() error
- func (s *Service) Stop() error
- func (s *Service) String() string
- func (s *Service) Subscribe(topic string, v interface{}) error
- func (s *Service) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle(h interface{}, opts ...server.HandlerOption) error
Handle is syntactic sugar for registering a handler
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is an object messages are published to
type Option ¶
type Option func(o *Options)
func BeforeStart ¶
BeforeStart run funcs before service starts
func HandleSignal ¶
HandleSignal toggles automatic installation of the signal handler that traps TERM, INT, and QUIT. Users of this feature to disable the signal handler, should control liveness of the service through the context.
func RegisterInterval ¶
RegisterInterval specifies the interval on which to re-register
func RegisterTTL ¶
RegisterTTL specifies the TTL to use when registering the service
func WrapCall ¶
func WrapCall(w ...client.CallWrapper) Option
WrapCall is a convenience method for wrapping a Client CallFunc
func WrapClient ¶
WrapClient is a convenience method for wrapping a Client with some middleware component. A list of wrappers can be provided. Wrappers are applied in reverse order so the last is executed first.
func WrapHandler ¶
func WrapHandler(w ...server.HandlerWrapper) Option
WrapHandler adds a handler Wrapper to a list of options passed into the server
func WrapSubscriber ¶
func WrapSubscriber(w ...server.SubscriberWrapper) Option
WrapSubscriber adds a subscriber Wrapper to a list of options passed into the server
type Options ¶
type Options struct { Cmd cmd.Cmd Name string Version string // Before and After funcs BeforeStart []func() error BeforeStop []func() error AfterStart []func() error AfterStop []func() error Signal bool }
Options for micro service
Directories ¶
Path | Synopsis |
---|---|
handler
Package handler provides http handlers
|
Package handler provides http handlers |
handler/api
Package api provides an http-rpc handler which provides the entire http request over rpc
|
Package api provides an http-rpc handler which provides the entire http request over rpc |
handler/event
Package event provides a handler which publishes an event
|
Package event provides a handler which publishes an event |
handler/http
Package http is a http reverse proxy handler
|
Package http is a http reverse proxy handler |
handler/rpc
Package rpc is a go-micro rpc handler.
|
Package rpc is a go-micro rpc handler. |
handler/web
Package web contains the web handler including websocket support
|
Package web contains the web handler including websocket support |
resolver
Package resolver resolves a http request to an endpoint
|
Package resolver resolves a http request to an endpoint |
resolver/grpc
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
|
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service |
resolver/host
Package host resolves using http host
|
Package host resolves using http host |
resolver/path
Package path resolves using http path
|
Package path resolves using http path |
resolver/subdomain
Package subdomain is a resolver which uses the subdomain to determine the domain to route to.
|
Package subdomain is a resolver which uses the subdomain to determine the domain to route to. |
resolver/vpath
Package vpath resolves using http path and recognised versioned urls
|
Package vpath resolves using http path and recognised versioned urls |
router
Package router provides api service routing
|
Package router provides api service routing |
router/registry
Package registry provides a dynamic api service router
|
Package registry provides a dynamic api service router |
server/http
Package http provides a http server with features; acme, cors, etc
|
Package http provides a http server with features; acme, cors, etc |
jwt
Package jwt is a jwt implementation of the auth interface
|
Package jwt is a jwt implementation of the auth interface |
Package broker is the micro broker
|
Package broker is the micro broker |
memory
Package memory provides a memory broker
|
Package memory provides a memory broker |
util/tar
Package tar is a wrapper around archive/tar, it's used for archiving and unarchiving source from and into folders on the host.
|
Package tar is a wrapper around archive/tar, it's used for archiving and unarchiving source from and into folders on the host. |
util/zip
Package zip is a wrapper around archive/zip, it's used for archiving and unarchiving source from and into folders on the host.
|
Package zip is a wrapper around archive/zip, it's used for archiving and unarchiving source from and into folders on the host. |
Package client is an interface for an RPC client
|
Package client is an interface for an RPC client |
grpc
Package grpc provides a gRPC client
|
Package grpc provides a gRPC client |
mucp
Package mucp provides a transport agnostic RPC client
|
Package mucp provides a transport agnostic RPC client |
Package config is an interface for dynamic configuration.
|
Package config is an interface for dynamic configuration. |
env
Package env provides config from environment variables
|
Package env provides config from environment variables |
Package context provides a context for accessing services
|
Package context provides a context for accessing services |
metadata
Package metadata is a way of defining message headers
|
Package metadata is a way of defining message headers |
handler
Package handler implements service debug handler embedded in go-micro services
|
Package handler implements service debug handler embedded in go-micro services |
log
Package log provides debug logging
|
Package log provides debug logging |
log/kubernetes
Package kubernetes is a logger implementing (github.com/micro/go-micro/v3/debug/log).Log
|
Package kubernetes is a logger implementing (github.com/micro/go-micro/v3/debug/log).Log |
log/memory
Package memory provides an in memory log buffer
|
Package memory provides an in memory log buffer |
profile
Package profile is for profilers
|
Package profile is for profilers |
profile/http
Package http enables the http profiler
|
Package http enables the http profiler |
profile/pprof
Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof
|
Package pprof provides a pprof profiler which writes output to /tmp/[name].{cpu,mem}.pprof |
stats
Package stats provides runtime stats
|
Package stats provides runtime stats |
trace
Package trace provides an interface for distributed tracing
|
Package trace provides an interface for distributed tracing |
Package errors provides a way to return detailed information for an RPC request error.
|
Package errors provides a way to return detailed information for an RPC request error. |
Package events is for event streaming and storage
|
Package events is for event streaming and storage |
Package log provides a log interface
|
Package log provides a log interface |
Package metrics is for instrumentation and debugging
|
Package metrics is for instrumentation and debugging |
Package model implements convenience methods for managing indexes on top of the Store.
|
Package model implements convenience methods for managing indexes on top of the Store. |
sql
Package sql is for a sql database model
|
Package sql is for a sql database model |
Package network implements micro network node
|
Package network implements micro network node |
resolver
Package resolver resolves network names to addresses
|
Package resolver resolves network names to addresses |
resolver/dns
Package dns resolves names to dns records
|
Package dns resolves names to dns records |
resolver/dnssrv
Package dns srv resolves names to dns srv records
|
Package dns srv resolves names to dns srv records |
resolver/http
Package http resolves names to network addresses using a http request
|
Package http resolves names to network addresses using a http request |
resolver/noop
Package noop is a noop resolver
|
Package noop is a noop resolver |
resolver/registry
Package registry resolves names using the go-micro registry
|
Package registry resolves names using the go-micro registry |
resolver/static
Package static is a static resolver
|
Package static is a static resolver |
transport
Package transport is an interface for synchronous connection based communication
|
Package transport is an interface for synchronous connection based communication |
transport/memory
Package memory is an in-memory transport
|
Package memory is an in-memory transport |
tunnel
Package tunnel provides gre network tunnelling
|
Package tunnel provides gre network tunnelling |
tunnel/broker
Package broker is a tunnel broker
|
Package broker is a tunnel broker |
tunnel/transport
Package transport provides a tunnel transport
|
Package transport provides a tunnel transport |
Package proxy is a transparent proxy built on the go-micro/server
|
Package proxy is a transparent proxy built on the go-micro/server |
grpc
Package grpc is a grpc proxy built for the go-micro/server
|
Package grpc is a grpc proxy built for the go-micro/server |
http
Package http provides a micro rpc to http proxy
|
Package http provides a micro rpc to http proxy |
mucp
Package mucp transparently forwards the incoming request using a go-micro client.
|
Package mucp transparently forwards the incoming request using a go-micro client. |
Package registry is the micro registry
|
Package registry is the micro registry |
cache
Package cache provides a registry cache
|
Package cache provides a registry cache |
memory
Package memory provides an in-memory registry
|
Package memory provides an in-memory registry |
noop
Package noop is a registry which does nothing
|
Package noop is a registry which does nothing |
kubernetes
Package kubernetes is a kubernetes router which uses the service name and network to route
|
Package kubernetes is a kubernetes router which uses the service name and network to route |
Package runtime is a service runtime manager
|
Package runtime is a service runtime manager |
kubernetes
Package kubernetes implements kubernetes micro runtime
|
Package kubernetes implements kubernetes micro runtime |
kubernetes/client
Package client provides an implementation of a restricted subset of kubernetes API client
|
Package client provides an implementation of a restricted subset of kubernetes API client |
local/process
Package process executes a binary
|
Package process executes a binary |
local/process/os
Package os runs processes locally
|
Package os runs processes locally |
local/test/bar
Package main is used to test the local runtime, specifically the entrypoint function
|
Package main is used to test the local runtime, specifically the entrypoint function |
local/test/foo/cmd/bar
Package main is used to test the local runtime, specifically the entrypoint function
|
Package main is used to test the local runtime, specifically the entrypoint function |
local/test/foo/cmd/baz
Package main is used to test the local runtime, specifically the entrypoint function
|
Package main is used to test the local runtime, specifically the entrypoint function |
local/test/qux/cmd/test
Package main is used to test the local runtime, specifically the entrypoint function
|
Package main is used to test the local runtime, specifically the entrypoint function |
source
Package source retrieves source code
|
Package source retrieves source code |
source/go
Package golang is a source for Go
|
Package golang is a source for Go |
grpc
Package grpc provides a grpc server
|
Package grpc provides a grpc server |
mucp
Package mucp provides a transport agnostic RPC server
|
Package mucp provides a transport agnostic RPC server |
Package store is an interface for distributed data storage.
|
Package store is an interface for distributed data storage. |
file
Package local is a file system backed store
|
Package local is a file system backed store |
memory
Package memory is a in-memory store store
|
Package memory is a in-memory store store |