v1

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1 is a generated protocol buffer package.

It is generated from these files:

app/service/main/passport-auth/api/grpc/v1/api.proto

It has these top-level messages:

GetCookieInfoReq
GetCookieInfoReply
GetTokenInfoReq
GetTokenInfoReply

Index

Constants

View Source
const AppID = "passport.service.auth"

AppID unique app id for service discovery

Variables

View Source
var (
	ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterAuthServer

func RegisterAuthServer(s *grpc.Server, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	// GetCookieInfo verify user info by cookie.
	GetCookieInfo(ctx context.Context, in *GetCookieInfoReq, opts ...grpc.CallOption) (*GetCookieInfoReply, error)
	// GetTokenInfo verify user info by token.
	GetTokenInfo(ctx context.Context, in *GetTokenInfoReq, opts ...grpc.CallOption) (*GetTokenInfoReply, error)
}

func NewAuthClient

func NewAuthClient(cc *grpc.ClientConn) AuthClient

func NewClient

func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (AuthClient, error)

NewClient new auth gRPC client

type AuthServer

type AuthServer interface {
	// GetCookieInfo verify user info by cookie.
	GetCookieInfo(context.Context, *GetCookieInfoReq) (*GetCookieInfoReply, error)
	// GetTokenInfo verify user info by token.
	GetTokenInfo(context.Context, *GetTokenInfoReq) (*GetTokenInfoReply, error)
}

type GetCookieInfoReply

type GetCookieInfoReply struct {
	// 用户是否登录
	IsLogin bool `protobuf:"varint,1,opt,name=is_login,json=isLogin,proto3" json:"is_login"`
	// user mid
	Mid int64 `protobuf:"varint,2,opt,name=mid,proto3" json:"mid"`
	// cookie csrf
	// when token reqest this field is empty
	Csrf string `protobuf:"bytes,3,opt,name=csrf,proto3" json:"csrfToken"`
	// expire time(unix timestamp)
	Expires int64 `protobuf:"varint,4,opt,name=expires,proto3" json:"expires"`
}

GetCookieInfoReply reply val for rpc CookieInfo

func (*GetCookieInfoReply) Descriptor

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

func (*GetCookieInfoReply) GetCsrf

func (m *GetCookieInfoReply) GetCsrf() string

func (*GetCookieInfoReply) GetExpires

func (m *GetCookieInfoReply) GetExpires() int64

func (*GetCookieInfoReply) GetIsLogin

func (m *GetCookieInfoReply) GetIsLogin() bool

func (*GetCookieInfoReply) GetMid

func (m *GetCookieInfoReply) GetMid() int64

func (*GetCookieInfoReply) Marshal

func (m *GetCookieInfoReply) Marshal() (dAtA []byte, err error)

func (*GetCookieInfoReply) MarshalTo

func (m *GetCookieInfoReply) MarshalTo(dAtA []byte) (int, error)

func (*GetCookieInfoReply) ProtoMessage

func (*GetCookieInfoReply) ProtoMessage()

func (*GetCookieInfoReply) Reset

func (m *GetCookieInfoReply) Reset()

func (*GetCookieInfoReply) Size

func (m *GetCookieInfoReply) Size() (n int)

func (*GetCookieInfoReply) String

func (m *GetCookieInfoReply) String() string

func (*GetCookieInfoReply) Unmarshal

func (m *GetCookieInfoReply) Unmarshal(dAtA []byte) error

type GetCookieInfoReq

type GetCookieInfoReq struct {
	// all user cookie of HTTP request
	// example: 'SESSDATA=DEE4597D836A5A9DA29DFC1AB1EFFDEB;sid=exampleSID'
	Cookie string `protobuf:"bytes,1,opt,name=cookie,proto3" json:"cookie,omitempty"`
}

GetCookieInfoReq request param for rpc CookieInfo

func (*GetCookieInfoReq) Descriptor

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

func (*GetCookieInfoReq) GetCookie

func (m *GetCookieInfoReq) GetCookie() string

func (*GetCookieInfoReq) Marshal

func (m *GetCookieInfoReq) Marshal() (dAtA []byte, err error)

func (*GetCookieInfoReq) MarshalTo

func (m *GetCookieInfoReq) MarshalTo(dAtA []byte) (int, error)

func (*GetCookieInfoReq) ProtoMessage

func (*GetCookieInfoReq) ProtoMessage()

func (*GetCookieInfoReq) Reset

func (m *GetCookieInfoReq) Reset()

func (*GetCookieInfoReq) Size

func (m *GetCookieInfoReq) Size() (n int)

func (*GetCookieInfoReq) String

func (m *GetCookieInfoReq) String() string

func (*GetCookieInfoReq) Unmarshal

func (m *GetCookieInfoReq) Unmarshal(dAtA []byte) error

type GetTokenInfoReply

type GetTokenInfoReply struct {
	// 用户是否登录
	IsLogin bool `protobuf:"varint,1,opt,name=is_login,json=isLogin,proto3" json:"is_login"`
	// user mid
	Mid int64 `protobuf:"varint,2,opt,name=mid,proto3" json:"mid"`
	// cookie csrf
	// when token reqest this field is empty
	Csrf string `protobuf:"bytes,3,opt,name=csrf,proto3" json:"csrfToken"`
	// expire time(unix timestamp)
	Expires int64 `protobuf:"varint,4,opt,name=expires,proto3" json:"expires"`
}

GetTokenInfoReply reply val for rpc TokenInfo

func (*GetTokenInfoReply) Descriptor

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

func (*GetTokenInfoReply) GetCsrf

func (m *GetTokenInfoReply) GetCsrf() string

func (*GetTokenInfoReply) GetExpires

func (m *GetTokenInfoReply) GetExpires() int64

func (*GetTokenInfoReply) GetIsLogin

func (m *GetTokenInfoReply) GetIsLogin() bool

func (*GetTokenInfoReply) GetMid

func (m *GetTokenInfoReply) GetMid() int64

func (*GetTokenInfoReply) Marshal

func (m *GetTokenInfoReply) Marshal() (dAtA []byte, err error)

func (*GetTokenInfoReply) MarshalTo

func (m *GetTokenInfoReply) MarshalTo(dAtA []byte) (int, error)

func (*GetTokenInfoReply) ProtoMessage

func (*GetTokenInfoReply) ProtoMessage()

func (*GetTokenInfoReply) Reset

func (m *GetTokenInfoReply) Reset()

func (*GetTokenInfoReply) Size

func (m *GetTokenInfoReply) Size() (n int)

func (*GetTokenInfoReply) String

func (m *GetTokenInfoReply) String() string

func (*GetTokenInfoReply) Unmarshal

func (m *GetTokenInfoReply) Unmarshal(dAtA []byte) error

type GetTokenInfoReq

type GetTokenInfoReq struct {
	// user access token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}

GetTokenInfoReq request param for rpc TokenInfo

func (*GetTokenInfoReq) Descriptor

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

func (*GetTokenInfoReq) GetToken

func (m *GetTokenInfoReq) GetToken() string

func (*GetTokenInfoReq) Marshal

func (m *GetTokenInfoReq) Marshal() (dAtA []byte, err error)

func (*GetTokenInfoReq) MarshalTo

func (m *GetTokenInfoReq) MarshalTo(dAtA []byte) (int, error)

func (*GetTokenInfoReq) ProtoMessage

func (*GetTokenInfoReq) ProtoMessage()

func (*GetTokenInfoReq) Reset

func (m *GetTokenInfoReq) Reset()

func (*GetTokenInfoReq) Size

func (m *GetTokenInfoReq) Size() (n int)

func (*GetTokenInfoReq) String

func (m *GetTokenInfoReq) String() string

func (*GetTokenInfoReq) Unmarshal

func (m *GetTokenInfoReq) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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