Documentation
¶
Index ¶
- Constants
- func CreateHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
- func DeleteHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
- func GetHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
- func ListHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
- func UpdateHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
- type Model
- type MySQLRepository
- func (repo MySQLRepository) Create(ctx context.Context, model Model) (int64, error)
- func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo MySQLRepository) GetById(ctx context.Context, id int64) (Model, error)
- func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)
- func (repo MySQLRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
- func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) error
- type PostgresRepository
- func (repo PostgresRepository) Create(ctx context.Context, model Model) (int64, error)
- func (repo PostgresRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo PostgresRepository) GetById(ctx context.Context, id int64) (Model, error)
- func (repo PostgresRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)
- func (repo PostgresRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
- func (repo PostgresRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) error
- type PricingTier
- func (pricingTier PricingTier) GetCreatedAt() time.Time
- func (pricingTier PricingTier) GetDeletedAt() *time.Time
- func (pricingTier PricingTier) GetDescription() *string
- func (pricingTier PricingTier) GetID() int64
- func (pricingTier PricingTier) GetName() *string
- func (pricingTier PricingTier) GetObjectId() int64
- func (pricingTier PricingTier) GetPricingTierId() string
- func (pricingTier PricingTier) GetUpdatedAt() time.Time
- func (pricingTier *PricingTier) SetDescription(newDescription *string)
- func (pricingTier *PricingTier) SetName(newName *string)
- func (pricingTier PricingTier) ToPricingTierSpec() *PricingTierSpec
- type PricingTierListParamParser
- type PricingTierRepository
- type PricingTierService
- func (svc PricingTierService) Create(ctx context.Context, pricingTierSpec PricingTierSpec) (*PricingTierSpec, error)
- func (svc PricingTierService) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (svc PricingTierService) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTierSpec, error)
- func (svc PricingTierService) List(ctx context.Context, listParams service.ListParams) ([]PricingTierSpec, error)
- func (svc PricingTierService) Routes() ([]service.Route, error)
- func (svc PricingTierService) UpdateByPricingTierId(ctx context.Context, pricingTierId string, ...) (*PricingTierSpec, error)
- type PricingTierSpec
- type SQLiteRepository
- func (repo SQLiteRepository) Create(ctx context.Context, model Model) (int64, error)
- func (repo SQLiteRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo SQLiteRepository) GetById(ctx context.Context, id int64) (Model, error)
- func (repo SQLiteRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)
- func (repo SQLiteRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
- func (repo SQLiteRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) error
- type UpdatePricingTierSpec
Constants ¶
View Source
const ResourceTypePricingTier = "pricing-tier"
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶ added in v0.11.0
func CreateHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
func DeleteHandler ¶ added in v0.11.0
func DeleteHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
func GetHandler ¶ added in v0.11.0
func GetHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
func ListHandler ¶ added in v0.11.0
func ListHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
func UpdateHandler ¶ added in v0.11.0
func UpdateHandler(svc PricingTierService, w http.ResponseWriter, r *http.Request) error
Types ¶
type Model ¶ added in v0.8.0
type Model interface {
GetID() int64
GetObjectId() int64
GetPricingTierId() string
GetName() *string
SetName(newName *string)
GetDescription() *string
SetDescription(newDescription *string)
GetCreatedAt() time.Time
GetUpdatedAt() time.Time
GetDeletedAt() *time.Time
ToPricingTierSpec() *PricingTierSpec
}
type MySQLRepository ¶
type MySQLRepository struct {
database.SQLRepository
}
func NewMySQLRepository ¶
func NewMySQLRepository(db *database.MySQL) MySQLRepository
func (MySQLRepository) DeleteByPricingTierId ¶
func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (MySQLRepository) GetByPricingTierId ¶
func (MySQLRepository) List ¶
func (repo MySQLRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
func (MySQLRepository) UpdateByPricingTierId ¶
type PostgresRepository ¶ added in v0.4.0
type PostgresRepository struct {
database.SQLRepository
}
func NewPostgresRepository ¶ added in v0.4.0
func NewPostgresRepository(db *database.Postgres) PostgresRepository
func (PostgresRepository) DeleteByPricingTierId ¶ added in v0.4.0
func (repo PostgresRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (PostgresRepository) GetByPricingTierId ¶ added in v0.4.0
func (PostgresRepository) List ¶ added in v0.4.0
func (repo PostgresRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
func (PostgresRepository) UpdateByPricingTierId ¶ added in v0.4.0
type PricingTier ¶
type PricingTier struct {
ID int64 `mysql:"id" postgres:"id" sqlite:"id"`
ObjectId int64 `mysql:"objectId" postgres:"object_id" sqlite:"objectId"`
PricingTierId string `mysql:"pricingTierId" postgres:"pricing_tier_id" sqlite:"pricingTierId"`
Name *string `mysql:"name" postgres:"name" sqlite:"name"`
Description *string `mysql:"description" postgres:"description" sqlite:"description"`
CreatedAt time.Time `mysql:"createdAt" postgres:"created_at" sqlite:"createdAt"`
UpdatedAt time.Time `mysql:"updatedAt" postgres:"updated_at" sqlite:"updatedAt"`
DeletedAt *time.Time `mysql:"deletedAt" postgres:"deleted_at" sqlite:"deletedAt"`
}
func (PricingTier) GetCreatedAt ¶ added in v0.8.0
func (pricingTier PricingTier) GetCreatedAt() time.Time
func (PricingTier) GetDeletedAt ¶ added in v0.8.0
func (pricingTier PricingTier) GetDeletedAt() *time.Time
func (PricingTier) GetDescription ¶ added in v0.8.0
func (pricingTier PricingTier) GetDescription() *string
func (PricingTier) GetID ¶ added in v0.8.0
func (pricingTier PricingTier) GetID() int64
func (PricingTier) GetName ¶ added in v0.8.0
func (pricingTier PricingTier) GetName() *string
func (PricingTier) GetObjectId ¶ added in v0.8.0
func (pricingTier PricingTier) GetObjectId() int64
func (PricingTier) GetPricingTierId ¶ added in v0.8.0
func (pricingTier PricingTier) GetPricingTierId() string
func (PricingTier) GetUpdatedAt ¶ added in v0.8.0
func (pricingTier PricingTier) GetUpdatedAt() time.Time
func (*PricingTier) SetDescription ¶ added in v0.8.0
func (pricingTier *PricingTier) SetDescription(newDescription *string)
func (*PricingTier) SetName ¶ added in v0.8.0
func (pricingTier *PricingTier) SetName(newName *string)
func (PricingTier) ToPricingTierSpec ¶
func (pricingTier PricingTier) ToPricingTierSpec() *PricingTierSpec
type PricingTierListParamParser ¶
type PricingTierListParamParser struct{}
func (PricingTierListParamParser) GetDefaultSortBy ¶
func (parser PricingTierListParamParser) GetDefaultSortBy() string
func (PricingTierListParamParser) GetSupportedSortBys ¶
func (parser PricingTierListParamParser) GetSupportedSortBys() []string
func (PricingTierListParamParser) ParseValue ¶
func (parser PricingTierListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type PricingTierRepository ¶
type PricingTierRepository interface {
Create(ctx context.Context, pricingTier Model) (int64, error)
GetById(ctx context.Context, id int64) (Model, error)
GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)
List(ctx context.Context, listParams service.ListParams) ([]Model, error)
UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier Model) error
DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
}
func NewRepository ¶
func NewRepository(db database.Database) (PricingTierRepository, error)
type PricingTierService ¶
type PricingTierService struct {
service.BaseService
Repository PricingTierRepository
EventSvc event.EventService
ObjectSvc object.ObjectService
}
func NewService ¶
func NewService(env service.Env, repository PricingTierRepository, eventSvc event.EventService, objectSvc object.ObjectService) PricingTierService
func (PricingTierService) Create ¶
func (svc PricingTierService) Create(ctx context.Context, pricingTierSpec PricingTierSpec) (*PricingTierSpec, error)
func (PricingTierService) DeleteByPricingTierId ¶
func (svc PricingTierService) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (PricingTierService) GetByPricingTierId ¶
func (svc PricingTierService) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTierSpec, error)
func (PricingTierService) List ¶
func (svc PricingTierService) List(ctx context.Context, listParams service.ListParams) ([]PricingTierSpec, error)
func (PricingTierService) Routes ¶ added in v0.8.0
func (svc PricingTierService) Routes() ([]service.Route, error)
GetRoutes registers all route handlers for this module
func (PricingTierService) UpdateByPricingTierId ¶
func (svc PricingTierService) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTierSpec UpdatePricingTierSpec) (*PricingTierSpec, error)
type PricingTierSpec ¶
type PricingTierSpec struct {
PricingTierId string `json:"pricingTierId" validate:"required,valid_object_id"`
Name *string `json:"name"`
Description *string `json:"description"`
CreatedAt time.Time `json:"createdAt"`
}
func (PricingTierSpec) ToObjectSpec ¶
func (spec PricingTierSpec) ToObjectSpec() *object.ObjectSpec
func (PricingTierSpec) ToPricingTier ¶
func (spec PricingTierSpec) ToPricingTier(objectId int64) Model
type SQLiteRepository ¶ added in v0.11.0
type SQLiteRepository struct {
database.SQLRepository
}
func NewSQLiteRepository ¶ added in v0.11.0
func NewSQLiteRepository(db *database.SQLite) SQLiteRepository
func (SQLiteRepository) DeleteByPricingTierId ¶ added in v0.11.0
func (repo SQLiteRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (SQLiteRepository) GetByPricingTierId ¶ added in v0.11.0
func (SQLiteRepository) List ¶ added in v0.11.0
func (repo SQLiteRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)
func (SQLiteRepository) UpdateByPricingTierId ¶ added in v0.11.0
type UpdatePricingTierSpec ¶
Click to show internal directories.
Click to hide internal directories.