format
This commit is contained in:
@@ -22,8 +22,11 @@ var ErrCapacityExceeded = errors.New("active stream capacity exceeded")
|
|||||||
var ErrInvalidRetentionHours = errors.New("message retention hours must be between 24 and 336")
|
var ErrInvalidRetentionHours = errors.New("message retention hours must be between 24 and 336")
|
||||||
|
|
||||||
type Service interface {
|
type Service interface {
|
||||||
|
// Create creates a network and adds adminHumanId as the first member. Returns ErrInvalidName if name is empty.
|
||||||
Create(ctx context.Context, name, adminHumanId string) (*Network, error)
|
Create(ctx context.Context, name, adminHumanId string) (*Network, error)
|
||||||
|
// GetByID returns ErrNotFound if network doesn't exist.
|
||||||
GetByID(ctx context.Context, id string) (*Network, error)
|
GetByID(ctx context.Context, id string) (*Network, error)
|
||||||
|
// SetName returns ErrNotFound or ErrInvalidName.
|
||||||
SetName(ctx context.Context, id, name string) error
|
SetName(ctx context.Context, id, name string) error
|
||||||
// AddMembers inserts members and syncs the new seat count to billing
|
// AddMembers inserts members and syncs the new seat count to billing
|
||||||
// atomically; a Stripe failure rolls the insert back.
|
// atomically; a Stripe failure rolls the insert back.
|
||||||
@@ -32,6 +35,7 @@ type Service interface {
|
|||||||
CountSeats(ctx context.Context, networkID string) (int, error)
|
CountSeats(ctx context.Context, networkID string) (int, error)
|
||||||
ListForHuman(ctx context.Context, humanId string) ([]*Network, error)
|
ListForHuman(ctx context.Context, humanId string) ([]*Network, error)
|
||||||
IsMember(ctx context.Context, networkID, humanId string) (bool, error)
|
IsMember(ctx context.Context, networkID, humanId string) (bool, error)
|
||||||
|
// ListAll returns all networks with their members
|
||||||
ListAll(ctx context.Context) ([]*Network, error)
|
ListAll(ctx context.Context) ([]*Network, error)
|
||||||
|
|
||||||
// Invitations (email-based, for users who haven't registered yet)
|
// Invitations (email-based, for users who haven't registered yet)
|
||||||
|
|||||||
Reference in New Issue
Block a user