Files
m3o-go/examples/otp/proto/otp.pb.m3o.go
2020-11-25 16:06:44 +00:00

102 lines
2.5 KiB
Go

// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: otp/proto/otp.proto
package otp
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
context "context"
api "github.com/micro/micro/v3/service/api"
client "github.com/micro/micro/v3/service/client"
server "github.com/micro/micro/v3/service/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for OTP service
func NewOTPEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for OTP service
type OTPService interface {
Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error)
Verify(ctx context.Context, in *VerifyRequest, opts ...client.CallOption) (*VerifyResponse, error)
}
type oTPService struct {
c client.Client
name string
}
func NewOTPClient() OTPService {
return &oTPService{}
}
func NewOTPMock() OTPService {
return &oTPService{}
}
func (c *oTPService) Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error) {
req := c.c.NewRequest(c.name, "OTP.Send", in)
out := new(SendResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *oTPService) Verify(ctx context.Context, in *VerifyRequest, opts ...client.CallOption) (*VerifyResponse, error) {
req := c.c.NewRequest(c.name, "OTP.Verify", in)
out := new(VerifyResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for OTP service
type OTPHandler interface {
Send(context.Context, *SendRequest) (*SendResponse, error)
Verify(context.Context, *VerifyRequest) (*VerifyResponse, error)
}
type oTPHandler struct {
OTPHandler
}
func (h *oTPHandler) Send(ctx context.Context, req *SendRequest) (*SendResponse, error) {
return h.OTPHandler.Send(ctx, req)
}
func (h *oTPHandler) Verify(ctx context.Context, req *VerifyRequest) (*VerifyResponse, error) {
return h.OTPHandler.Verify(ctx, req)
}