server

package
v1.0.0-beta.226 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL          string
	NamespaceDecoder namespacedriver.NamespaceDecoder
	ErrorHandler     errorsx.Handler
	Middlewares      []func(http.Handler) http.Handler

	// services
	MeterService            meter.ManageService
	IngestService           ingest.Service
	CustomerService         customer.Service
	EntitlementService      entitlement.Service
	PlanService             plan.Service
	PlanSubscriptionService plansubscription.PlanSubscriptionService
	SubscriptionService     subscription.Service
}

func (*Config) Validate

func (c *Config) Validate() error

type Server

type Server struct {
	*Config
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *Config) (*Server, error)

func (*Server) CancelSubscription

func (s *Server) CancelSubscription(w http.ResponseWriter, r *http.Request, subscriptionId api.ULID)

func (*Server) ChangeSubscription

func (s *Server) ChangeSubscription(w http.ResponseWriter, r *http.Request, subscriptionId api.ULID)

func (*Server) CreateCustomer

func (s *Server) CreateCustomer(w http.ResponseWriter, r *http.Request)

func (*Server) CreateMeter

func (s *Server) CreateMeter(w http.ResponseWriter, r *http.Request)

Meters

func (*Server) CreateSubscription

func (s *Server) CreateSubscription(w http.ResponseWriter, r *http.Request)

func (*Server) DeleteCustomer

func (s *Server) DeleteCustomer(w http.ResponseWriter, r *http.Request, customerId api.ULID)

func (*Server) DeleteMeter

func (s *Server) DeleteMeter(w http.ResponseWriter, r *http.Request, meterId api.ULID)

func (*Server) GetCustomer

func (s *Server) GetCustomer(w http.ResponseWriter, r *http.Request, customerId api.ULID)

func (*Server) GetMeter

func (s *Server) GetMeter(w http.ResponseWriter, r *http.Request, meterId api.ULID)

func (*Server) GetSubscription

func (s *Server) GetSubscription(w http.ResponseWriter, r *http.Request, subscriptionId api.ULID)

func (*Server) IngestMeteringEvents

func (s *Server) IngestMeteringEvents(w http.ResponseWriter, r *http.Request)

func (*Server) ListCustomerEntitlementAccess

func (s *Server) ListCustomerEntitlementAccess(w http.ResponseWriter, r *http.Request, customerId api.ULID)

func (*Server) ListCustomers

func (s *Server) ListCustomers(w http.ResponseWriter, r *http.Request, params api.ListCustomersParams)

func (*Server) ListMeters

func (s *Server) ListMeters(w http.ResponseWriter, r *http.Request, params api.ListMetersParams)

func (*Server) ListSubscriptions

func (s *Server) ListSubscriptions(w http.ResponseWriter, r *http.Request, params api.ListSubscriptionsParams)

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes(r chi.Router) error

func (*Server) UnscheduleCancelation

func (s *Server) UnscheduleCancelation(w http.ResponseWriter, r *http.Request, subscriptionId api.ULID)

func (*Server) UpsertCustomer

func (s *Server) UpsertCustomer(w http.ResponseWriter, r *http.Request, customerId api.ULID)

Jump to

Keyboard shortcuts

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