hospital

package
v0.0.0-...-e50672f Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_domain_hospital_proto_hospital_proto protoreflect.FileDescriptor
View Source
var HospitalService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hospital.HospitalService",
	HandlerType: (*HospitalServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _HospitalService_List_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _HospitalService_Get_Handler,
		},
		{
			MethodName: "Add",
			Handler:    _HospitalService_Add_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "domain/hospital/proto/hospital.proto",
}

HospitalService_ServiceDesc is the grpc.ServiceDesc for HospitalService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewHospitalGrpcHandler

func NewHospitalGrpcHandler(p_oGrpcService hospitalService) hospitalGrpcHandler

Declare Hospital GRPC Handler @Param hospitalService

func NewHospitalHandler

func NewHospitalHandler(p_oService hospitalService) hospitalHandler

Declare Hospital Handler @Param appointmentService aka p_oService

func NewHospitalRepository

func NewHospitalRepository(p_oDatabase *sqlx.DB) hospitalRepository

Declare Hospital Repository

func NewHospitalService

func NewHospitalService() hospitalService

Declare Hospital Service

func NewHospitalServiceDB

func NewHospitalServiceDB(oRepo Repository) hospitalService

func RegisterHospitalServiceServer

func RegisterHospitalServiceServer(s grpc.ServiceRegistrar, srv HospitalServiceServer)

func RouterInit

func RouterInit(r fiber.Router)

func RouterInitGRPC

func RouterInitGRPC(server *grpc.Server, db *sqlx.DB)

func RouterInitWithDB

func RouterInitWithDB(r fiber.Router, dbx *sqlx.DB)

Types

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

func ValidateStruct

func ValidateStruct(user interface{}) []ErrorResponse

type Hospital

type Hospital struct {
	HealthcareId   string    `db:"healthcare_id"`
	HealthcareName string    `db:"healthcare_name"`
	IsActive       bool      `db:"is_active"`
	UserCreate     string    `db:"user_create"`
	CreateAt       time.Time `db:"create_at"`
}

Declare Hospital Entity

type HospitalAddProto

type HospitalAddProto struct {
	Addhospital *HospitalProto `protobuf:"bytes,1,opt,name=addhospital,proto3" json:"addhospital,omitempty"`
	// contains filtered or unexported fields
}

Add hospital

func (*HospitalAddProto) Descriptor deprecated

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

Deprecated: Use HospitalAddProto.ProtoReflect.Descriptor instead.

func (*HospitalAddProto) GetAddhospital

func (x *HospitalAddProto) GetAddhospital() *HospitalProto

func (*HospitalAddProto) ProtoMessage

func (*HospitalAddProto) ProtoMessage()

func (*HospitalAddProto) ProtoReflect

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

func (*HospitalAddProto) Reset

func (x *HospitalAddProto) Reset()

func (*HospitalAddProto) String

func (x *HospitalAddProto) String() string

type HospitalGetProto

type HospitalGetProto struct {
	HealthcareId string `protobuf:"bytes,1,opt,name=healthcare_id,json=healthcareId,proto3" json:"healthcare_id,omitempty"`
	// contains filtered or unexported fields
}

Get Hospital based on Healthcare ID

func (*HospitalGetProto) Descriptor deprecated

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

Deprecated: Use HospitalGetProto.ProtoReflect.Descriptor instead.

func (*HospitalGetProto) GetHealthcareId

func (x *HospitalGetProto) GetHealthcareId() string

func (*HospitalGetProto) ProtoMessage

func (*HospitalGetProto) ProtoMessage()

func (*HospitalGetProto) ProtoReflect

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

func (*HospitalGetProto) Reset

func (x *HospitalGetProto) Reset()

func (*HospitalGetProto) String

func (x *HospitalGetProto) String() string

type HospitalListProto

type HospitalListProto struct {
	Hospitals []*HospitalProto `protobuf:"bytes,1,rep,name=hospitals,proto3" json:"hospitals,omitempty"`
	// contains filtered or unexported fields
}

[Response] Get hospital list

func (*HospitalListProto) Descriptor deprecated

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

Deprecated: Use HospitalListProto.ProtoReflect.Descriptor instead.

func (*HospitalListProto) GetHospitals

func (x *HospitalListProto) GetHospitals() []*HospitalProto

func (*HospitalListProto) ProtoMessage

func (*HospitalListProto) ProtoMessage()

func (*HospitalListProto) ProtoReflect

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

func (*HospitalListProto) Reset

func (x *HospitalListProto) Reset()

func (*HospitalListProto) String

func (x *HospitalListProto) String() string

type HospitalListResponse

type HospitalListResponse struct {
	HealthcareId   string    `json:"HealthcareId"`
	HealthcareName string    `json:"HealthcareName"`
	IsActive       bool      `json:"IsActive"`
	UserCreate     string    `json:"UserCreate"`
	CreateAt       time.Time `json:"CreateAt"`
}

[Response] Declare Hospital List construct

type HospitalProto

type HospitalProto struct {
	HealthcareId   string                 `protobuf:"bytes,1,opt,name=healthcare_id,json=healthcareId,proto3" json:"healthcare_id,omitempty"`
	HealthcareName string                 `protobuf:"bytes,2,opt,name=healthcare_name,json=healthcareName,proto3" json:"healthcare_name,omitempty"`
	IsActive       bool                   `protobuf:"varint,3,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
	UserCreate     string                 `protobuf:"bytes,4,opt,name=user_create,json=userCreate,proto3" json:"user_create,omitempty"`
	CreateAt       *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
	// contains filtered or unexported fields
}

[Respon] Get Hospital

func (*HospitalProto) Descriptor deprecated

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

Deprecated: Use HospitalProto.ProtoReflect.Descriptor instead.

func (*HospitalProto) GetCreateAt

func (x *HospitalProto) GetCreateAt() *timestamppb.Timestamp

func (*HospitalProto) GetHealthcareId

func (x *HospitalProto) GetHealthcareId() string

func (*HospitalProto) GetHealthcareName

func (x *HospitalProto) GetHealthcareName() string

func (*HospitalProto) GetIsActive

func (x *HospitalProto) GetIsActive() bool

func (*HospitalProto) GetUserCreate

func (x *HospitalProto) GetUserCreate() string

func (*HospitalProto) ProtoMessage

func (*HospitalProto) ProtoMessage()

func (*HospitalProto) ProtoReflect

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

func (*HospitalProto) Reset

func (x *HospitalProto) Reset()

func (*HospitalProto) String

func (x *HospitalProto) String() string

type HospitalRequest

type HospitalRequest struct {
	HealthcareId   string    `json:"HealthcareId"`
	HealthcareName string    `json:"HealthcareName"`
	IsActive       bool      `json:"IsActive"`
	UserCreate     string    `json:"UserCreate"`
	CreateAt       time.Time `json:"CreateAt"`
}

[Request] Declare Hospital List construct

func (HospitalRequest) ParseToEntity

func (a HospitalRequest) ParseToEntity() Hospital

Convert Object to Entity

type HospitalServiceClient

type HospitalServiceClient interface {
	List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HospitalListProto, error)
	Get(ctx context.Context, in *HospitalGetProto, opts ...grpc.CallOption) (*HospitalProto, error)
	Add(ctx context.Context, in *HospitalAddProto, opts ...grpc.CallOption) (*HospitalProto, error)
}

HospitalServiceClient is the client API for HospitalService 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.

type HospitalServiceServer

type HospitalServiceServer interface {
	List(context.Context, *emptypb.Empty) (*HospitalListProto, error)
	Get(context.Context, *HospitalGetProto) (*HospitalProto, error)
	Add(context.Context, *HospitalAddProto) (*HospitalProto, error)
	// contains filtered or unexported methods
}

HospitalServiceServer is the server API for HospitalService service. All implementations must embed UnimplementedHospitalServiceServer for forward compatibility

type Repository

type Repository interface {
	AddRepo(ctx context.Context, h Hospital) (p_strHealthcareId string, err error)
	GetRepo(ctx context.Context, healthcareid string) (res []Hospital, err error)
	GetListHospital(ctx context.Context) ([]Hospital, error)
}

type UnimplementedHospitalServiceServer

type UnimplementedHospitalServiceServer struct {
}

UnimplementedHospitalServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedHospitalServiceServer) Add

func (UnimplementedHospitalServiceServer) Get

func (UnimplementedHospitalServiceServer) List

type UnsafeHospitalServiceServer

type UnsafeHospitalServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeHospitalServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HospitalServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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