Documentation
¶
Index ¶
- func CreateHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
- func DeleteHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
- func GetHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
- func ListHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
- func UpdateHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
- type FeatureListParamParser
- type FeatureService
- func (svc FeatureService) Create(ctx context.Context, featureSpec FeatureSpec) (*FeatureSpec, error)
- func (svc FeatureService) DeleteByFeatureId(ctx context.Context, featureId string) error
- func (svc FeatureService) GetByFeatureId(ctx context.Context, featureId string) (*FeatureSpec, error)
- func (svc FeatureService) List(ctx context.Context, listParams service.ListParams) ([]FeatureSpec, error)
- func (svc FeatureService) Routes() ([]service.Route, error)
- func (svc FeatureService) UpdateByFeatureId(ctx context.Context, featureId string, featureSpec UpdateFeatureSpec) (*FeatureSpec, error)
- type FeatureSpec
- type UpdateFeatureSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶ added in v0.11.0
func CreateHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
func DeleteHandler ¶ added in v0.11.0
func DeleteHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
func GetHandler ¶ added in v0.11.0
func GetHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
func ListHandler ¶ added in v0.11.0
func ListHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
func UpdateHandler ¶ added in v0.11.0
func UpdateHandler(svc FeatureService, w http.ResponseWriter, r *http.Request) error
Types ¶
type FeatureListParamParser ¶
type FeatureListParamParser struct{}
func (FeatureListParamParser) GetDefaultSortBy ¶
func (parser FeatureListParamParser) GetDefaultSortBy() string
func (FeatureListParamParser) GetSupportedSortBys ¶
func (parser FeatureListParamParser) GetSupportedSortBys() []string
func (FeatureListParamParser) ParseValue ¶
func (parser FeatureListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type FeatureService ¶
type FeatureService struct {
service.BaseService
EventSvc event.Service
ObjectSvc *object.ObjectService
}
func NewService ¶
func NewService(env service.Env, eventSvc event.Service, objectSvc *object.ObjectService) *FeatureService
func (FeatureService) Create ¶
func (svc FeatureService) Create(ctx context.Context, featureSpec FeatureSpec) (*FeatureSpec, error)
func (FeatureService) DeleteByFeatureId ¶
func (svc FeatureService) DeleteByFeatureId(ctx context.Context, featureId string) error
func (FeatureService) GetByFeatureId ¶
func (svc FeatureService) GetByFeatureId(ctx context.Context, featureId string) (*FeatureSpec, error)
func (FeatureService) List ¶
func (svc FeatureService) List(ctx context.Context, listParams service.ListParams) ([]FeatureSpec, error)
func (FeatureService) Routes ¶ added in v0.8.0
func (svc FeatureService) Routes() ([]service.Route, error)
GetRoutes registers all route handlers for this module
func (FeatureService) UpdateByFeatureId ¶
func (svc FeatureService) UpdateByFeatureId(ctx context.Context, featureId string, featureSpec UpdateFeatureSpec) (*FeatureSpec, error)
type FeatureSpec ¶
type FeatureSpec struct {
FeatureId string `json:"featureId" validate:"required,valid_object_id"`
Name *string `json:"name"`
Description *string `json:"description"`
CreatedAt time.Time `json:"createdAt"`
}
func NewFeatureSpecFromObjectSpec ¶ added in v0.36.0
func NewFeatureSpecFromObjectSpec(objectSpec *object.ObjectSpec) (*FeatureSpec, error)
func (FeatureSpec) ToCreateObjectSpec ¶ added in v0.34.0
func (spec FeatureSpec) ToCreateObjectSpec() (*object.CreateObjectSpec, error)
type UpdateFeatureSpec ¶
type UpdateFeatureSpec struct {
Name *string `json:"name"`
Description *string `json:"description"`
}
func (UpdateFeatureSpec) ToUpdateObjectSpec ¶ added in v0.36.0
func (updateSpec UpdateFeatureSpec) ToUpdateObjectSpec() *object.UpdateObjectSpec
Click to show internal directories.
Click to hide internal directories.