service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Verify",
			Handler:    _Auth_Verify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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)

Functions

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type APIServer

type APIServer struct {
	UnimplementedAuthServer
	// contains filtered or unexported fields
}

func NewAPIServer

func NewAPIServer() (*APIServer, error)

NewAPIServer builds new instance of the ApiServer

func (*APIServer) Start

func (s *APIServer) Start(ctx *cli.Context) error

func (*APIServer) Verify

func (s *APIServer) Verify(ctx context.Context, token *Token) (*Token, error)

type AuthClient

type AuthClient interface {
	Verify(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Token, 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 AuthInterceptor

type AuthInterceptor interface {
	GetFirebaseAuthServiceAddr() string

	AuthUnaryInterceptor(ctx context.Context,
		req interface{},
		info *grpc.UnaryServerInfo,
		handler grpc.UnaryHandler,
	) (interface{}, error)

	AuthStreamInterceptor(
		srv interface{},
		stream grpc.ServerStream,
		info *grpc.StreamServerInfo,
		handler grpc.StreamHandler,
	) error
}

AuthInterceptor is interface for declare auth interceptor

func NewAuthInterceptor

func NewAuthInterceptor(authServiceAddress string) AuthInterceptor

NewAuthInterceptor returns new instance of auth interceptor

type AuthServer

type AuthServer interface {
	Verify(context.Context, *Token) (*Token, error)
	// contains filtered or unexported methods
}

AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility

type ConfigKey

type ConfigKey string

type Token

type Token struct {
	Token  string  `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	UserId *string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3,oneof" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

func (*Token) Descriptor() ([]byte, []int)

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetToken

func (x *Token) GetToken() string

func (*Token) GetUserId

func (x *Token) GetUserId() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) Verify

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.

Jump to

Keyboard shortcuts

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