Documentation
¶
Index ¶
- func NewCreateSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewDeleteSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewFindSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewListSubscriptionsHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewUpdateSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- type CreateSubscriptionRequest
- type CreateSubscriptionResponse
- type DeleteSubscriptionRequest
- type DeleteSubscriptionResponse
- type DeletedSubscriptionResponse
- type FindSubscriptionRequest
- type FindSubscriptionResponse
- type ListSubscriptionsRequest
- type ListSubscriptionsResponse
- type SubscriptionCourseResponse
- type SubscriptionMatrixResponse
- type SubscriptionResponse
- type SubscriptionsResponse
- type UpdateSubscriptionRequest
- type UpdateSubscriptionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateSubscriptionHandler ¶
func NewCreateSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewCreateSubscriptionHandler creates new subscription handler @Summary Create subscription @Description Create a new subscription @Tags subscriptions @Accept json @Produce json @Param subscription body CreateSubscriptionRequest true "Add Subscription" @Success 200 {object} CreateSubscriptionResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /subscriptions [post].
func NewDeleteSubscriptionHandler ¶
func NewDeleteSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewDeleteSubscriptionHandler deletes subscription handler @Summary Delete subscription @Description Delete a new subscription @Tags subscriptions @Produce json @Param uuid path string true "Subscription UUID" Format(uuid) @Success 200 {object} DeleteSubscriptionResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /subscriptions/{uuid} [delete].
func NewFindSubscriptionHandler ¶
func NewFindSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewFindSubscriptionHandler find subscription handler @Summary Find subscription @Description Find a new subscription @Tags subscriptions @Produce json @Param uuid path string true "Subscription UUID" Format(uuid) @Success 200 {object} FindSubscriptionResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /subscriptions/{uuid} [get].
func NewListSubscriptionsHandler ¶
func NewListSubscriptionsHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewListSubscriptionsHandler list subscriptions handler @Summary List subscriptions @Description List a new subscriptions @Tags subscriptions @Produce json @Param course_uuid query string false "course search by uuid" Format(uuid) @Param user_uuid query string false "user search by uuid" Format(uuid) @Success 200 {object} ListSubscriptionsResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /subscriptions [get].
func NewUpdateSubscriptionHandler ¶
func NewUpdateSubscriptionHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewUpdateSubscriptionHandler updates new subscription handler @Summary Update subscription @Description Update a subscription @Tags subscriptions @Accept json @Produce json @Param uuid path string true "Subscription UUID" Format(uuid) @Param subscription body UpdateSubscriptionRequest true "Update Subscription" @Success 200 {object} UpdateSubscriptionResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /subscriptions/{uuid} [put].
Types ¶
type CreateSubscriptionResponse ¶
type CreateSubscriptionResponse struct {
Subscription *SubscriptionResponse `json:"subscription"`
}
type DeleteSubscriptionResponse ¶
type DeleteSubscriptionResponse struct {
Subscription *DeletedSubscriptionResponse `json:"subscription"`
}
type FindSubscriptionRequest ¶
type FindSubscriptionResponse ¶
type FindSubscriptionResponse struct {
Subscription *SubscriptionResponse `json:"subscription"`
}
type ListSubscriptionsResponse ¶
type ListSubscriptionsResponse struct {
Subscriptions []SubscriptionsResponse `json:"subscriptions"`
}
type SubscriptionCourseResponse ¶
type SubscriptionCourseResponse struct { UUID uuid.UUID `db:"uuid" json:"uuid"` Code string `db:"code" json:"code"` Name string `db:"name" json:"name"` }
func SerializeCourse ¶
func SerializeCourse(subscription domain.Subscription) *SubscriptionCourseResponse
type SubscriptionMatrixResponse ¶
type SubscriptionMatrixResponse struct { UUID *uuid.UUID `db:"uuid" json:"uuid,omitempty"` Code *string `db:"code" json:"code,omitempty"` Name *string `db:"name" json:"name,omitempty"` }
func SerializeMatrix ¶
func SerializeMatrix(subscription domain.Subscription) *SubscriptionMatrixResponse
type SubscriptionResponse ¶
type SubscriptionResponse struct { UUID uuid.UUID `json:"uuid"` UserUUID uuid.UUID `json:"user_uuid"` CourseUUID *uuid.UUID `json:"course_uuid,omitempty"` MatrixUUID *uuid.UUID `json:"matrix_uuid,omitempty"` Role string `json:"role"` ExpiresAt *time.Time `json:"expires_at,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type SubscriptionsResponse ¶
type SubscriptionsResponse struct { UUID uuid.UUID `json:"uuid"` UserUUID uuid.UUID `json:"user_uuid"` Course *SubscriptionCourseResponse `json:"course,omitempty"` CourseUUID *uuid.UUID `json:"course_uuid,omitempty"` Matrix *SubscriptionMatrixResponse `json:"matrix,omitempty"` MatrixUUID *uuid.UUID `json:"matrix_uuid,omitempty"` Role string `json:"role"` ExpiresAt *time.Time `json:"expires_at,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type UpdateSubscriptionResponse ¶
type UpdateSubscriptionResponse struct {
Subscription *SubscriptionResponse `json:"subscription"`
}