authz

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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) Create

func (repo MySQLRepository) Create(ctx context.Context, model Model) (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) (Model, error)

func (MySQLRepository) GetByPricingTierId

func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)

func (MySQLRepository) List

func (repo MySQLRepository) List(ctx context.Context, listParams service.ListParams) ([]Model, error)

func (MySQLRepository) UpdateByPricingTierId

func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) 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, model Model) (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) (Model, error)

func (PostgresRepository) GetByPricingTierId added in v0.4.0

func (repo PostgresRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)

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

func (repo PostgresRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) error

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) Create added in v0.11.0

func (repo SQLiteRepository) Create(ctx context.Context, model Model) (int64, error)

func (SQLiteRepository) DeleteByPricingTierId added in v0.11.0

func (repo SQLiteRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error

func (SQLiteRepository) GetById added in v0.11.0

func (repo SQLiteRepository) GetById(ctx context.Context, id int64) (Model, error)

func (SQLiteRepository) GetByPricingTierId added in v0.11.0

func (repo SQLiteRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (Model, error)

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

func (repo SQLiteRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, model Model) error

type UpdatePricingTierSpec

type UpdatePricingTierSpec struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL