Documentation
¶
Index ¶
- func Close()
- func GetSrv() *grpc.Server
- func Start(address string)
- type Client
- func NewClient(serverAddress string) *Client
- func NewClientCustomAuthentication(serverAddress string, credential credentials.PerRPCCredentials) *Client
- func NewClientTLS(serverAddress string, cp *x509.CertPool, serverNameOverride string) *Client
- func NewClientTLSCustomAuthentication(serverAddress string, cp *x509.CertPool, serverNameOverride string, ...) *Client
- func NewClientTLSFromFile(serverAddress string, certFile, serverNameOverride string) *Client
- type CustomCredential
- type GetCustomAuthenticationParameter
- type Server
- func NewServer(address string) *Server
- func NewServerCustomAuthentication(address string, validation ValidationFunc) *Server
- func NewServerTLS(address string, cert *tls.Certificate) *Server
- func NewServerTLSCustomAuthentication(address string, cert *tls.Certificate, validation ValidationFunc) *Server
- func NewServerTLSFromFile(address string, certFile, keyFile string) *Server
- type ValidationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client grpc客户端
func NewClientCustomAuthentication ¶
func NewClientCustomAuthentication(serverAddress string, credential credentials.PerRPCCredentials) *Client
NewClientCustomAuthentication 创建grpc客户端自定义服务验证
func NewClientTLS ¶
NewClientTLS 创建grpc客户端
func NewClientTLSCustomAuthentication ¶
func NewClientTLSCustomAuthentication(serverAddress string, cp *x509.CertPool, serverNameOverride string, credential credentials.PerRPCCredentials) *Client
NewClientTLSCustomAuthentication 创建grpc客户端TLS自定义服务验证
func NewClientTLSFromFile ¶
NewClientTLSFromFile 创建grpc客户端TLSFromFile
type CustomCredential ¶
CustomCredential 自定义凭证
func NewCustomCredential ¶
func NewCustomCredential(appKey, appSecret string, tls bool) *CustomCredential
NewCustomCredential 创建自定义凭证
func (CustomCredential) GetRequestMetadata ¶
func (c CustomCredential) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
GetRequestMetadata Get请求元数据
func (CustomCredential) RequireTransportSecurity ¶
func (c CustomCredential) RequireTransportSecurity() bool
RequireTransportSecurity 是否安全传输
type GetCustomAuthenticationParameter ¶
type GetCustomAuthenticationParameter func() (appID, appKey string)
GetCustomAuthenticationParameter 获取自定义参数
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server 服务端
func NewServerCustomAuthentication ¶
func NewServerCustomAuthentication(address string, validation ValidationFunc) *Server
NewServerCustomAuthentication 创建服务端自定义服务验证
func NewServerTLS ¶
func NewServerTLS(address string, cert *tls.Certificate) *Server
NewServerTLS 创建服务端TLS
func NewServerTLSCustomAuthentication ¶
func NewServerTLSCustomAuthentication(address string, cert *tls.Certificate, validation ValidationFunc) *Server
NewServerTLSCustomAuthentication 创建服务端TLS自定义服务验证
func NewServerTLSFromFile ¶
NewServerTLSFromFile 创建服务端TLSFromFile
Click to show internal directories.
Click to hide internal directories.