service

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: Apache-2.0 Imports: 27 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPath

func BuildPath(dirRoot string, c model.Config) string

func GetEndpoint

func GetEndpoint(addr string) discovery.ServiceEndpoint

func InitConfig

func InitConfig(etcdPeers string, dirRoot string, c model.Config)

func InitConfigByEtcd

func InitConfigByEtcd(etcdPeers string, target interface{}, dir string)

func StartPProf

func StartPProf()

func StartPProfWithAddr

func StartPProfWithAddr(addr string)

func StartPProfWithPort

func StartPProfWithPort(port int)

func WithConfigDir

func WithConfigDir(path string) string

Types

type GatewayConfig

type GatewayConfig struct {
	// 集群配置
	PayConfig *model.PayConfig
	// 通知配置
	NoticeConfig *model.NoticeConfig
	// AppId和费率配置
	AppIdAndChannelConfigMap *model.AppIdAndChannelConfigMap
	// AppId和商户配置
	AppIdAndMerchantMap *model.MerchantConfigMap
	// 服务和对应的部署服务名映射
	ServiceMap *model.ServiceConfigMap
	// Channel和对应host配置
	ChannelServiceMap *model.ChannelServiceConfigMap
}

func InitGatewayConfig

func InitGatewayConfig(etcdPeers string, dirRoot string) *GatewayConfig

type RegisterGrpcFunc

type RegisterGrpcFunc = func(server *grpc.Server)

type Service

type Service struct {
	DiscoveryService      discovery.DiscoveryService
	ListenAddr            string
	ConfigURI             string
	TlsEnable             bool
	LogLevel              string
	LogFormat             string
	CaCert                string
	TlsCert               string
	TlsKey                string
	ServiceName           string
	RegisterServiceToEtcd bool
	EtcdPeers             string
	ServiceDir            string
	// contains filtered or unexported fields
}

func InitService

func InitService(
	listenAddr string,
	configURI string,
	tlsEnable bool,
	logLevel string,
	logFormat string,
	caCert string,
	tlsCert string,
	tlsKey string,
	serviceName string,
	registerServiceToEtcd bool,
	etcdPeers string,
	serviceDir string,
) (service *Service)

func (*Service) Dial

func (svc *Service) Dial(host string, port string, options ...grpc.DialOption) (*grpc.ClientConn, error)

func (*Service) GetGrpcConnectionByDiscoveryService

func (svc *Service) GetGrpcConnectionByDiscoveryService(serviceName string, port string, options ...grpc.DialOption) (*grpc.ClientConn, error)

func (*Service) StartGrpc

func (service *Service) StartGrpc(register RegisterGrpcFunc)

func (*Service) TlsDialGrpcOptions

func (service *Service) TlsDialGrpcOptions() []grpc.DialOption

func (*Service) TlsGrpcOptions

func (service *Service) TlsGrpcOptions() []grpc.ServerOption

Jump to

Keyboard shortcuts

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