Documentation ¶
Index ¶
- Constants
- Variables
- type CustomerService
- type Filter
- type PlanService
- type Repository
- type Service
- func (s *Service) Cancel(ctx context.Context, id string) (Subscription, error)
- func (s *Service) Close() error
- func (s *Service) Create(ctx context.Context, sub Subscription) (Subscription, error)
- func (s *Service) GetByID(ctx context.Context, id string) (Subscription, error)
- func (s *Service) GetByProviderID(ctx context.Context, id string) (Subscription, error)
- func (s *Service) Init(ctx context.Context)
- func (s *Service) List(ctx context.Context, filter Filter) ([]Subscription, error)
- func (s *Service) SyncWithProvider(ctx context.Context, customerID string) error
- type State
- type Subscription
Constants ¶
View Source
const (
SyncDelay = time.Second * 60
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CustomerService ¶
type PlanService ¶
type Repository ¶
type Repository interface { GetByID(ctx context.Context, id string) (Subscription, error) Create(ctx context.Context, subs Subscription) (Subscription, error) UpdateByID(ctx context.Context, subs Subscription) (Subscription, error) List(ctx context.Context, filter Filter) ([]Subscription, error) GetByProviderID(ctx context.Context, id string) (Subscription, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(stripeClient *client.API, repository Repository, customerService CustomerService, planService PlanService) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, sub Subscription) (Subscription, error)
func (*Service) GetByProviderID ¶
type Subscription ¶
Click to show internal directories.
Click to hide internal directories.