Documentation
¶
Index ¶
- Constants
- 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 middleware.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 middleware.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() database.NullTime
- func (pricingTier PricingTier) GetDescription() database.NullString
- func (pricingTier PricingTier) GetID() int64
- func (pricingTier PricingTier) GetName() database.NullString
- func (pricingTier PricingTier) GetObjectId() int64
- func (pricingTier PricingTier) GetPricingTierId() string
- func (pricingTier PricingTier) GetUpdatedAt() time.Time
- func (pricingTier *PricingTier) SetDescription(newDescription database.NullString)
- func (pricingTier *PricingTier) SetName(newName database.NullString)
- 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 middleware.ListParams) ([]PricingTierSpec, error)
- func (svc PricingTierService) Routes() []service.Route
- 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 Model ¶ added in v0.8.0
type Model interface {
GetID() int64
GetObjectId() int64
GetPricingTierId() string
GetName() database.NullString
SetName(newName database.NullString)
GetDescription() database.NullString
SetDescription(newDescription database.NullString)
GetCreatedAt() time.Time
GetUpdatedAt() time.Time
GetDeletedAt() database.NullTime
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 middleware.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 middleware.ListParams) ([]Model, error)
func (PostgresRepository) UpdateByPricingTierId ¶ added in v0.4.0
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) GetCreatedAt ¶ added in v0.8.0
func (pricingTier PricingTier) GetCreatedAt() time.Time
func (PricingTier) GetDeletedAt ¶ added in v0.8.0
func (pricingTier PricingTier) GetDeletedAt() database.NullTime
func (PricingTier) GetDescription ¶ added in v0.8.0
func (pricingTier PricingTier) GetDescription() database.NullString
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() database.NullString
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 database.NullString)
func (*PricingTier) SetName ¶ added in v0.8.0
func (pricingTier *PricingTier) SetName(newName database.NullString)
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 middleware.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
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env service.Env, repo 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 middleware.ListParams) ([]PricingTierSpec, error)
func (PricingTierService) Routes ¶ added in v0.8.0
func (svc PricingTierService) Routes() []service.Route
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"`
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) Model
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.