authz

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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) 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 middleware.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 middleware.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"`
	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 (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 (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"`
}

Jump to

Keyboard shortcuts

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