Documentation
¶
Index ¶
- Constants
- type MySQLRepository
- func (repo MySQLRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
- func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo MySQLRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
- func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
- func (repo MySQLRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
- func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
- type PostgresRepository
- func (repo PostgresRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
- func (repo PostgresRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo PostgresRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
- func (repo PostgresRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
- func (repo PostgresRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
- func (repo PostgresRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
- type PricingTier
- 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) GetRoutes() []service.Route
- func (svc PricingTierService) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTierSpec, error)
- func (svc PricingTierService) UpdateByPricingTierId(ctx context.Context, pricingTierId string, ...) (*PricingTierSpec, error)
- type PricingTierSpec
- type UpdatePricingTierSpec
Constants ¶
View Source
const ResourceTypePricingTier = "pricing-tier"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLRepository ¶
type MySQLRepository struct {
database.SQLRepository
}
func NewMySQLRepository ¶
func NewMySQLRepository(db *database.MySQL) MySQLRepository
func (MySQLRepository) Create ¶
func (repo MySQLRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
func (MySQLRepository) DeleteByPricingTierId ¶
func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (MySQLRepository) GetById ¶
func (repo MySQLRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
func (MySQLRepository) GetByPricingTierId ¶
func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
func (MySQLRepository) List ¶
func (repo MySQLRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
func (MySQLRepository) UpdateByPricingTierId ¶
func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
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) Create ¶ added in v0.4.0
func (repo PostgresRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
func (PostgresRepository) DeleteByPricingTierId ¶ added in v0.4.0
func (repo PostgresRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (PostgresRepository) GetById ¶ added in v0.4.0
func (repo PostgresRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
func (PostgresRepository) GetByPricingTierId ¶ added in v0.4.0
func (repo PostgresRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
func (PostgresRepository) List ¶ added in v0.4.0
func (repo PostgresRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
func (PostgresRepository) UpdateByPricingTierId ¶ added in v0.4.0
func (repo PostgresRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
type PricingTier ¶
type PricingTier struct {
ID int64 `mysql:"id" postgres:"id"`
ObjectId int64 `mysql:"objectId" postgres:"object_id"`
PricingTierId string `mysql:"pricingTierId" postgres:"pricing_tier_id"`
Name database.NullString `mysql:"name" postgres:"name"`
Description database.NullString `mysql:"description" postgres:"description"`
CreatedAt time.Time `mysql:"createdAt" postgres:"created_at"`
UpdatedAt time.Time `mysql:"updatedAt" postgres:"updated_at"`
DeletedAt database.NullTime `mysql:"deletedAt" postgres:"deleted_at"`
}
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 PricingTier) (int64, error)
GetById(ctx context.Context, id int64) (*PricingTier, error)
GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
}
func NewRepository ¶
func NewRepository(db database.Database) (PricingTierRepository, error)
type PricingTierService ¶
type PricingTierService struct {
service.BaseService
}
func NewService ¶
func NewService(env service.Env) 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) GetRoutes ¶
func (svc PricingTierService) GetRoutes() []service.Route
GetRoutes registers all route handlers for this module
func (PricingTierService) List ¶
func (svc PricingTierService) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTierSpec, error)
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"`
Name database.NullString `json:"name"`
Description database.NullString `json:"description"`
Context context.ContextSetSpec `json:"context,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
func (PricingTierSpec) ToObjectSpec ¶
func (spec PricingTierSpec) ToObjectSpec() *object.ObjectSpec
func (PricingTierSpec) ToPricingTier ¶
func (spec PricingTierSpec) ToPricingTier(objectId int64) *PricingTier
type UpdatePricingTierSpec ¶
type UpdatePricingTierSpec struct {
Name database.NullString `json:"name"`
Description database.NullString `json:"description"`
}
Click to show internal directories.
Click to hide internal directories.