Documentation ¶
Index ¶
- Variables
- func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
- type AuthClient
- type AuthServer
- type CreateTokenRequest
- func (*CreateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTokenRequest) GetAppid() string
- func (x *CreateTokenRequest) GetAppkey() string
- func (x *CreateTokenRequest) GetExp() *durationpb.Duration
- func (x *CreateTokenRequest) GetUuid() string
- func (*CreateTokenRequest) ProtoMessage()
- func (x *CreateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *CreateTokenRequest) Reset()
- func (x *CreateTokenRequest) String() string
- type CreateTokenResponse
- func (*CreateTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateTokenResponse) GetBeginTime() *timestamppb.Timestamp
- func (x *CreateTokenResponse) GetEndTime() *timestamppb.Timestamp
- func (x *CreateTokenResponse) GetToken() string
- func (*CreateTokenResponse) ProtoMessage()
- func (x *CreateTokenResponse) ProtoReflect() protoreflect.Message
- func (x *CreateTokenResponse) Reset()
- func (x *CreateTokenResponse) String() string
- type UnimplementedAuthServer
- type UnsafeAuthServer
Constants ¶
This section is empty.
Variables ¶
var Auth_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sogou.speech.auth.v1.auth", HandlerType: (*AuthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateToken", Handler: _Auth_CreateToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "sogou/speech/auth/v1/auth.proto", }
Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_sogou_speech_auth_v1_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthServer ¶
func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
Types ¶
type AuthClient ¶
type AuthClient interface { // Performs create token from appid and appkey operation. Token created by this method // can be used for other service which your app enables. // For security reasons, the number of calling create token request per minute will be limited // in a reasonable range due to the quota of specific app CreateToken(ctx context.Context, in *CreateTokenRequest, opts ...grpc.CallOption) (*CreateTokenResponse, error) }
AuthClient is the client API for Auth service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAuthClient ¶
func NewAuthClient(cc grpc.ClientConnInterface) AuthClient
type AuthServer ¶
type AuthServer interface { // Performs create token from appid and appkey operation. Token created by this method // can be used for other service which your app enables. // For security reasons, the number of calling create token request per minute will be limited // in a reasonable range due to the quota of specific app CreateToken(context.Context, *CreateTokenRequest) (*CreateTokenResponse, error) // contains filtered or unexported methods }
AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility
type CreateTokenRequest ¶
type CreateTokenRequest struct { // *Required* appid applies from sogou speech official website Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` // *Required* secret appkey of app Appkey string `protobuf:"bytes,2,opt,name=appkey,proto3" json:"appkey,omitempty"` // *Required* valid duration for this token. // for security reasons, this duration // must not greater than 10 hours Exp *durationpb.Duration `protobuf:"bytes,3,opt,name=exp,proto3" json:"exp,omitempty"` // *Optional* If set, token will be created with the uuid. // and other invokes of sogou speech services with this token will be // validated by the same uuid Uuid string `protobuf:"bytes,4,opt,name=uuid,proto3" json:"uuid,omitempty"` // contains filtered or unexported fields }
func (*CreateTokenRequest) Descriptor
deprecated
func (*CreateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateTokenRequest.ProtoReflect.Descriptor instead.
func (*CreateTokenRequest) GetAppid ¶
func (x *CreateTokenRequest) GetAppid() string
func (*CreateTokenRequest) GetAppkey ¶
func (x *CreateTokenRequest) GetAppkey() string
func (*CreateTokenRequest) GetExp ¶
func (x *CreateTokenRequest) GetExp() *durationpb.Duration
func (*CreateTokenRequest) GetUuid ¶
func (x *CreateTokenRequest) GetUuid() string
func (*CreateTokenRequest) ProtoMessage ¶
func (*CreateTokenRequest) ProtoMessage()
func (*CreateTokenRequest) ProtoReflect ¶
func (x *CreateTokenRequest) ProtoReflect() protoreflect.Message
func (*CreateTokenRequest) Reset ¶
func (x *CreateTokenRequest) Reset()
func (*CreateTokenRequest) String ¶
func (x *CreateTokenRequest) String() string
type CreateTokenResponse ¶
type CreateTokenResponse struct { // token created Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // when this token begin effective BeginTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=begin_time,json=beginTime,proto3" json:"begin_time,omitempty"` // when this token will expired EndTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // contains filtered or unexported fields }
func (*CreateTokenResponse) Descriptor
deprecated
func (*CreateTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateTokenResponse.ProtoReflect.Descriptor instead.
func (*CreateTokenResponse) GetBeginTime ¶
func (x *CreateTokenResponse) GetBeginTime() *timestamppb.Timestamp
func (*CreateTokenResponse) GetEndTime ¶
func (x *CreateTokenResponse) GetEndTime() *timestamppb.Timestamp
func (*CreateTokenResponse) GetToken ¶
func (x *CreateTokenResponse) GetToken() string
func (*CreateTokenResponse) ProtoMessage ¶
func (*CreateTokenResponse) ProtoMessage()
func (*CreateTokenResponse) ProtoReflect ¶
func (x *CreateTokenResponse) ProtoReflect() protoreflect.Message
func (*CreateTokenResponse) Reset ¶
func (x *CreateTokenResponse) Reset()
func (*CreateTokenResponse) String ¶
func (x *CreateTokenResponse) String() string
type UnimplementedAuthServer ¶
type UnimplementedAuthServer struct { }
UnimplementedAuthServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServer) CreateToken ¶
func (UnimplementedAuthServer) CreateToken(context.Context, *CreateTokenRequest) (*CreateTokenResponse, error)
type UnsafeAuthServer ¶
type UnsafeAuthServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServer will result in compilation errors.