Documentation ¶
Index ¶
- func RegisterAuthHandler(s server.Server, hdlr AuthHandler, opts ...server.HandlerOption)
- type Auth
- func (model *Auth) BeforeCreate(scope *gorm.Scope) error
- func (h *Auth) Create(ctx context.Context, in *User, out *Response) error
- func (h *Auth) Get(ctx context.Context, in *User, out *Response) error
- func (h *Auth) GetAll(ctx context.Context, in *Request, out *Response) error
- func (h *Auth) Login(ctx context.Context, in *User, out *Token) error
- func (h *Auth) ValidateToken(ctx context.Context, in *Token, out *Token) error
- type AuthClient
- type AuthHandler
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (m *Error) GetCode() int32
- func (m *Error) GetDescription() string
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) String() string
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetCreatedAt() *timestamp.Timestamp
- func (m *Response) GetErrors() []*Error
- func (m *Response) GetToken() *Token
- func (m *Response) GetUser() *User
- func (m *Response) GetUsers() []*User
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type Token
- func (*Token) Descriptor() ([]byte, []int)
- func (m *Token) GetErrors() []*Error
- func (m *Token) GetToken() string
- func (m *Token) GetValid() bool
- func (*Token) ProtoMessage()
- func (m *Token) Reset()
- func (m *Token) String() string
- func (m *Token) XXX_DiscardUnknown()
- func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Token) XXX_Merge(src proto.Message)
- func (m *Token) XXX_Size() int
- func (m *Token) XXX_Unmarshal(b []byte) error
- type User
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) GetEmail() string
- func (m *User) GetId() string
- func (m *User) GetName() string
- func (m *User) GetPassword() string
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) String() string
- func (m *User) XXX_DiscardUnknown()
- func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *User) XXX_Merge(src proto.Message)
- func (m *User) XXX_Size() int
- func (m *User) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthHandler ¶
func RegisterAuthHandler(s server.Server, hdlr AuthHandler, opts ...server.HandlerOption)
Types ¶
type Auth ¶
type Auth struct {
AuthHandler
}
func (*Auth) BeforeCreate ¶
BeforeCreate generates a uuid for the user before adding them to the db
type AuthClient ¶
type AuthClient interface { Create(ctx context.Context, in *User, opts ...client.CallOption) (*Response, error) Login(ctx context.Context, in *User, opts ...client.CallOption) (*Token, error) Get(ctx context.Context, in *User, opts ...client.CallOption) (*Response, error) GetAll(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) ValidateToken(ctx context.Context, in *Token, opts ...client.CallOption) (*Token, error) }
func NewAuthClient ¶
func NewAuthClient(serviceName string, c client.Client) AuthClient
type AuthHandler ¶
type Error ¶
type Error struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Error) Descriptor ¶
func (*Error) GetDescription ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type Request ¶
type Request struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Request) Descriptor ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
type Response ¶
type Response struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Users []*User `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` Errors []*Error `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` Token *Token `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Response) Descriptor ¶
func (*Response) GetCreatedAt ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
type Token ¶
type Token struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` Valid bool `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"` Errors []*Error `protobuf:"bytes,3,rep,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Token) Descriptor ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) XXX_DiscardUnknown ¶
func (m *Token) XXX_DiscardUnknown()
func (*Token) XXX_Marshal ¶
func (*Token) XXX_Unmarshal ¶
type User ¶
type User struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*User) Descriptor ¶
func (*User) GetPassword ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.