Documentation ¶
Index ¶
- Variables
- func ProtobufToUser(ub *User) (*domain.User, error)
- func ProtobufToUsers(users *Users) (*domain.Users, error)
- func RegisterUserServerServer(s *grpc.Server, srv UserServerServer)
- type BulkResponse
- func (*BulkResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BulkResponse) GetOverallStatus() StatusEnum
- func (x *BulkResponse) GetResponse() []*Response
- func (*BulkResponse) ProtoMessage()
- func (x *BulkResponse) ProtoReflect() protoreflect.Message
- func (x *BulkResponse) Reset()
- func (x *BulkResponse) String() string
- type HealthMsg
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetErrMsg() string
- func (x *Response) GetErrReason() int64
- func (x *Response) GetStatus() StatusEnum
- func (x *Response) GetUserID() *UserID
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type RoleEnum
- type StatusEnum
- type UnimplementedUserServerServer
- func (*UnimplementedUserServerServer) CreateUser(context.Context, *User) (*UserID, error)
- func (*UnimplementedUserServerServer) CreateUsers(context.Context, *Users) (*BulkResponse, error)
- func (*UnimplementedUserServerServer) DeleteUser(context.Context, *UserID) (*empty.Empty, error)
- func (*UnimplementedUserServerServer) GetUser(context.Context, *UserID) (*User, error)
- func (*UnimplementedUserServerServer) GetUsers(context.Context, *empty.Empty) (*Users, error)
- func (*UnimplementedUserServerServer) Health(context.Context, *empty.Empty) (*HealthMsg, error)
- func (*UnimplementedUserServerServer) UpdateUser(context.Context, *User) (*empty.Empty, error)
- func (*UnimplementedUserServerServer) UpdateUsers(context.Context, *Users) (*BulkResponse, error)
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAccountID() int64
- func (x *User) GetEMail() string
- func (x *User) GetHREF() string
- func (x *User) GetID() int64
- func (x *User) GetName() string
- func (x *User) GetPassword() string
- func (x *User) GetRole() RoleEnum
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserID
- type UserIDs
- type UserServer
- func (s *UserServer) CreateUser(ctx context.Context, u *User) (*UserID, error)
- func (s *UserServer) CreateUsers(ctx context.Context, users *Users) (*BulkResponse, error)
- func (s *UserServer) DeleteUser(ctx context.Context, id *UserID) (*empty.Empty, error)
- func (s *UserServer) GetUser(ctx context.Context, rqst *UserID) (*User, error)
- func (s *UserServer) GetUsers(ctx context.Context, x *empty.Empty) (*Users, error)
- func (s *UserServer) Health(ctx context.Context, _ *empty.Empty) (*HealthMsg, error)
- func (s *UserServer) UpdateUser(ctx context.Context, u *User) (*empty.Empty, error)
- func (s *UserServer) UpdateUsers(ctx context.Context, users *Users) (*BulkResponse, error)
- type UserServerClient
- type UserServerServer
- type Users
Constants ¶
This section is empty.
Variables ¶
var ( RoleEnum_name = map[int32]string{ 0: "PRIMARY", 1: "UNRESTRICTED", 2: "RESTRICTED", } RoleEnum_value = map[string]int32{ "PRIMARY": 0, "UNRESTRICTED": 1, "RESTRICTED": 2, } )
Enum value maps for RoleEnum.
var ( StatusEnum_name = map[int32]string{ 0: "StatusBadRequest", 1: "StatusOK", 2: "StatusCreated", 3: "StatusConflict", 4: "StatusServerError", 5: "StatusNotFound", } StatusEnum_value = map[string]int32{ "StatusBadRequest": 0, "StatusOK": 1, "StatusCreated": 2, "StatusConflict": 3, "StatusServerError": 4, "StatusNotFound": 5, } )
Enum value maps for StatusEnum.
var File_pkg_protobuf_accountd_user_service_proto protoreflect.FileDescriptor
var UserRqstDur = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "mockvideo", Subsystem: "user", Name: "user_request_duration_seconds", Help: "user request duration distribution in seconds", Buckets: prometheus.LinearBuckets(0.001, .004, 50), }, []string{rqstStatus})
UserRqstDur is used to capture the length of HTTP requests
Functions ¶
func ProtobufToUser ¶
ProtobufToUser converts a User to a domwin.User
func ProtobufToUsers ¶
ProtobufToUsers converts a Users to a domain.User
func RegisterUserServerServer ¶
func RegisterUserServerServer(s *grpc.Server, srv UserServerServer)
Types ¶
type BulkResponse ¶
type BulkResponse struct { OverallStatus StatusEnum `protobuf:"varint,1,opt,name=OverallStatus,proto3,enum=accountd.StatusEnum" json:"OverallStatus,omitempty"` Response []*Response `protobuf:"bytes,2,rep,name=Response,proto3" json:"Response,omitempty"` // contains filtered or unexported fields }
func (*BulkResponse) Descriptor
deprecated
func (*BulkResponse) Descriptor() ([]byte, []int)
Deprecated: Use BulkResponse.ProtoReflect.Descriptor instead.
func (*BulkResponse) GetOverallStatus ¶
func (x *BulkResponse) GetOverallStatus() StatusEnum
func (*BulkResponse) GetResponse ¶
func (x *BulkResponse) GetResponse() []*Response
func (*BulkResponse) ProtoMessage ¶
func (*BulkResponse) ProtoMessage()
func (*BulkResponse) ProtoReflect ¶
func (x *BulkResponse) ProtoReflect() protoreflect.Message
func (*BulkResponse) Reset ¶
func (x *BulkResponse) Reset()
func (*BulkResponse) String ¶
func (x *BulkResponse) String() string
type HealthMsg ¶
type HealthMsg struct { Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"Status,omitempty"` // contains filtered or unexported fields }
func (*HealthMsg) Descriptor
deprecated
func (*HealthMsg) ProtoMessage ¶
func (*HealthMsg) ProtoMessage()
func (*HealthMsg) ProtoReflect ¶
func (x *HealthMsg) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Status StatusEnum `protobuf:"varint,1,opt,name=Status,proto3,enum=accountd.StatusEnum" json:"Status,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` ErrReason int64 `protobuf:"varint,3,opt,name=ErrReason,proto3" json:"ErrReason,omitempty"` UserID *UserID `protobuf:"bytes,4,opt,name=UserID,proto3" json:"UserID,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetErrReason ¶
func (*Response) GetStatus ¶
func (x *Response) GetStatus() StatusEnum
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type RoleEnum ¶
type RoleEnum int32
func (RoleEnum) Descriptor ¶
func (RoleEnum) Descriptor() protoreflect.EnumDescriptor
func (RoleEnum) EnumDescriptor
deprecated
func (RoleEnum) Number ¶
func (x RoleEnum) Number() protoreflect.EnumNumber
func (RoleEnum) Type ¶
func (RoleEnum) Type() protoreflect.EnumType
type StatusEnum ¶
type StatusEnum int32
const ( // StatusBadRequest indicates that the client submitted an invalid request StatusEnum_StatusBadRequest StatusEnum = 0 // StatusOK indicates the request completed successfully StatusEnum_StatusOK StatusEnum = 1 // StatusCreated indicates that the requested resource was created StatusEnum_StatusCreated StatusEnum = 2 // StatusConflict indicates that one or more of a set of bulk requests failed StatusEnum_StatusConflict StatusEnum = 3 // StatusServerError indicates that the server encountered an error while servicing the request StatusEnum_StatusServerError StatusEnum = 4 // StatusNotFound indicates the requested resource does not exist StatusEnum_StatusNotFound StatusEnum = 5 )
func (StatusEnum) Descriptor ¶
func (StatusEnum) Descriptor() protoreflect.EnumDescriptor
func (StatusEnum) Enum ¶
func (x StatusEnum) Enum() *StatusEnum
func (StatusEnum) EnumDescriptor
deprecated
func (StatusEnum) EnumDescriptor() ([]byte, []int)
Deprecated: Use StatusEnum.Descriptor instead.
func (StatusEnum) Number ¶
func (x StatusEnum) Number() protoreflect.EnumNumber
func (StatusEnum) String ¶
func (x StatusEnum) String() string
func (StatusEnum) Type ¶
func (StatusEnum) Type() protoreflect.EnumType
type UnimplementedUserServerServer ¶
type UnimplementedUserServerServer struct { }
UnimplementedUserServerServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserServerServer) CreateUser ¶
func (*UnimplementedUserServerServer) CreateUsers ¶
func (*UnimplementedUserServerServer) CreateUsers(context.Context, *Users) (*BulkResponse, error)
func (*UnimplementedUserServerServer) DeleteUser ¶
func (*UnimplementedUserServerServer) UpdateUser ¶
func (*UnimplementedUserServerServer) UpdateUsers ¶
func (*UnimplementedUserServerServer) UpdateUsers(context.Context, *Users) (*BulkResponse, error)
type User ¶
type User struct { AccountID int64 `protobuf:"varint,1,opt,name=AccountID,proto3" json:"AccountID,omitempty"` HREF string `protobuf:"bytes,2,opt,name=HREF,proto3" json:"HREF,omitempty"` ID int64 `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,4,opt,name=Name,proto3" json:"Name,omitempty"` EMail string `protobuf:"bytes,5,opt,name=EMail,proto3" json:"EMail,omitempty"` Role RoleEnum `protobuf:"varint,6,opt,name=Role,proto3,enum=accountd.RoleEnum" json:"Role,omitempty"` Password string `protobuf:"bytes,7,opt,name=Password,proto3" json:"Password,omitempty"` // contains filtered or unexported fields }
func DomainUserToProtobuf ¶
DomainUserToProtobuf converts a User domain object into a protobuf User
func (*User) Descriptor
deprecated
func (*User) GetAccountID ¶
func (*User) GetPassword ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserID ¶
type UserID struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*UserID) Descriptor
deprecated
func (*UserID) ProtoMessage ¶
func (*UserID) ProtoMessage()
func (*UserID) ProtoReflect ¶
func (x *UserID) ProtoReflect() protoreflect.Message
type UserIDs ¶
type UserIDs struct { UserID []*UserID `protobuf:"bytes,1,rep,name=userID,proto3" json:"userID,omitempty"` // contains filtered or unexported fields }
func (*UserIDs) Descriptor
deprecated
func (*UserIDs) ProtoMessage ¶
func (*UserIDs) ProtoMessage()
func (*UserIDs) ProtoReflect ¶
func (x *UserIDs) ProtoReflect() protoreflect.Message
type UserServer ¶
type UserServer struct {
// contains filtered or unexported fields
}
UserServer implements the gRPC functions required to provide access to user related services
func (*UserServer) CreateUser ¶
CreateUser creates a new User
func (*UserServer) CreateUsers ¶
func (s *UserServer) CreateUsers(ctx context.Context, users *Users) (*BulkResponse, error)
CreateUsers creates users from the provided 'users' parameter
func (*UserServer) DeleteUser ¶
DeleteUser updates an existing user
func (*UserServer) UpdateUser ¶
UpdateUser updates an existing user
func (*UserServer) UpdateUsers ¶
func (s *UserServer) UpdateUsers(ctx context.Context, users *Users) (*BulkResponse, error)
UpdateUsers updates the set of users provided in the 'users' parameter
type UserServerClient ¶
type UserServerClient interface { GetUser(ctx context.Context, in *UserID, opts ...grpc.CallOption) (*User, error) GetUsers(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Users, error) CreateUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*UserID, error) CreateUsers(ctx context.Context, in *Users, opts ...grpc.CallOption) (*BulkResponse, error) UpdateUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*empty.Empty, error) UpdateUsers(ctx context.Context, in *Users, opts ...grpc.CallOption) (*BulkResponse, error) DeleteUser(ctx context.Context, in *UserID, opts ...grpc.CallOption) (*empty.Empty, error) Health(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HealthMsg, error) }
UserServerClient is the client API for UserServer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUserServerClient ¶
func NewUserServerClient(cc grpc.ClientConnInterface) UserServerClient
type UserServerServer ¶
type UserServerServer interface { GetUser(context.Context, *UserID) (*User, error) GetUsers(context.Context, *empty.Empty) (*Users, error) CreateUser(context.Context, *User) (*UserID, error) CreateUsers(context.Context, *Users) (*BulkResponse, error) UpdateUser(context.Context, *User) (*empty.Empty, error) UpdateUsers(context.Context, *Users) (*BulkResponse, error) DeleteUser(context.Context, *UserID) (*empty.Empty, error) Health(context.Context, *empty.Empty) (*HealthMsg, error) }
UserServerServer is the server API for UserServer service.
func NewUserServer ¶
func NewUserServer(userSvc services.UserSvcInterface, logger *log.Entry) (UserServerServer, error)
NewUserServer returns a properly configured grpc Server
type Users ¶
type Users struct { Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
func DomainUsersToProtobuf ¶
DomainUsersToProtobuf converts a Users domain object into a protobuf Users
func (*Users) Descriptor
deprecated
func (*Users) ProtoMessage ¶
func (*Users) ProtoMessage()
func (*Users) ProtoReflect ¶
func (x *Users) ProtoReflect() protoreflect.Message