defaults

package
v2.3.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: AGPL-3.0 Imports: 16 Imported by: 512

Documentation

Overview

Package defaults initializes the defaults GRPC clients and servers used by services

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultStartupRegistry registry.Registry
)

Functions

func Broker

func Broker() broker.Broker

func InitClient

func InitClient(opt ...func() client.Option)

func InitHTTPServer

func InitHTTPServer(opt ...func() server.Option)

func InitServer

func InitServer(opt ...func() server.Option)

func NetworkClientWrapper

func NetworkClientWrapper(c client.Client) client.Client

func NewClient

func NewClient(new ...client.Option) client.Client

NewClient returns a client attached to the defaults

func NewHTTPServer

func NewHTTPServer(new ...server.Option) server.Server

func NewServer

func NewServer(new ...server.Option) server.Server

NewServer returns a server attached to the defaults

func Registry

func Registry() registry.Registry

func RuntimeIsCluster

func RuntimeIsCluster() bool

RuntimeIsCluster checks if the runtime is configured to use cluster routes

func RuntimeIsFork

func RuntimeIsFork() bool

RuntimeIsFork checks if the runtime is originally a fork of a different process

func StartupRegistry

func StartupRegistry() registry.Registry

func Transport

func Transport() transport.Transport

Types

type Option

type Option func(*Options)

func WithBroker

func WithBroker(b broker.Broker) Option

func WithCert

func WithCert(c string, k string) Option

func WithRegistry

func WithRegistry(r registry.Registry) Option

func WithTransport

func WithTransport(t transport.Transport) Option

type Options

type Options struct {
	Selector  selector.Selector
	Registry  registry.Registry
	Broker    broker.Broker
	Transport transport.Transport
	CertFile  string
	KeyFile   string
	Client    func(new ...client.Option) client.Client
	Server    func(new ...server.Option) server.Server
}

Directories

Path Synopsis
api
stan
Package stan provides a NATS Streaming broker
Package stan provides a NATS Streaming broker
client
grpc
Package grpc provides a gRPC client Package grpc provides a gRPC options
Package grpc provides a gRPC client Package grpc provides a gRPC options
Package router provides api service routing
Package router provides api service routing
cache
Package cache is a caching selector.
Package cache is a caching selector.
grpc
Package grpc provides a grpc server
Package grpc provides a grpc server
http
Package http implements a go-micro.Server
Package http implements a go-micro.Server
transport

Jump to

Keyboard shortcuts

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