Documentation ¶
Index ¶
- Constants
- func Dial(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func DialContext(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func DialContextWithEtcd(ctx context.Context, serviceName string, cli *goo_etcd.Client, ...) (*grpc.ClientConn, error)
- func DialWithEtcd(serviceName string, cli *goo_etcd.Client, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- type AuthFunc
- type Config
- type PProf
- type Server
- type ServerOption
Constants ¶
View Source
const ( MaxRecvMsgSize = 20 * 1024 * 1024 MaxSendMsgSize = 20 * 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func DialContext ¶ added in v1.1.72
func DialContext(ctx context.Context, addr string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func DialContextWithEtcd ¶ added in v1.1.72
func DialContextWithEtcd(ctx context.Context, serviceName string, cli *goo_etcd.Client, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func DialWithEtcd ¶ added in v1.0.2
func DialWithEtcd(serviceName string, cli *goo_etcd.Client, opts ...grpc.DialOption) (*grpc.ClientConn, error)
Types ¶
type Config ¶ added in v1.0.2
type Config struct { // 服务名称 ServiceName string `json:"service_name" yaml:"service_name"` // 对外开放地址 ServiceEndpoint string `json:"service_endpoint" yaml:"service_endpoint"` // 监听地址 Addr string `json:"addr" yaml:"addr"` // 超时时间(单位秒) KeepaliveTime time.Duration `json:"keepalive_time" yaml:"keepalive_time"` KeepaliveTimeout time.Duration `json:"keepalive_timeout" yaml:"keepalive_timeout"` // ping包最短等待时间(单位秒) EnforcementPolicyMinTime time.Duration `json:"enforcement_policy_min_time" yaml:"enforcement_policy_min_time"` }
type Server ¶
func New ¶
func New(conf Config, opt ...ServerOption) *Server
func (*Server) Register2Etcd ¶ added in v1.0.2
type ServerOption ¶ added in v1.1.1
type ServerOption interface {
// contains filtered or unexported methods
}
定义配置项抽象
func AuthFuncOption ¶ added in v1.1.1
func AuthFuncOption(authFunc AuthFunc) ServerOption
配置项 - 认证方法
func ServerOptions ¶ added in v1.1.1
func ServerOptions(opt ...grpc.ServerOption) ServerOption
配置项 - grpc server options
Click to show internal directories.
Click to hide internal directories.