Documentation ¶
Index ¶
- type Manager
- func (m *Manager) Add(ctx context.Context, org *hub.Organization) error
- func (m *Manager) AddMember(ctx context.Context, orgName, userAlias, baseURL string) error
- func (m *Manager) CheckAvailability(ctx context.Context, resourceKind, value string) (bool, error)
- func (m *Manager) ConfirmMembership(ctx context.Context, orgName string) error
- func (m *Manager) DeleteMember(ctx context.Context, orgName, userAlias string) error
- func (m *Manager) GetByUserJSON(ctx context.Context) ([]byte, error)
- func (m *Manager) GetJSON(ctx context.Context, orgName string) ([]byte, error)
- func (m *Manager) GetMembersJSON(ctx context.Context, orgName string) ([]byte, error)
- func (m *Manager) Update(ctx context.Context, org *hub.Organization) error
- type ManagerMock
- func (m *ManagerMock) Add(ctx context.Context, org *hub.Organization) error
- func (m *ManagerMock) AddMember(ctx context.Context, orgName, userAlias, baseURL string) error
- func (m *ManagerMock) CheckAvailability(ctx context.Context, resourceKind, value string) (bool, error)
- func (m *ManagerMock) ConfirmMembership(ctx context.Context, orgName string) error
- func (m *ManagerMock) DeleteMember(ctx context.Context, orgName, userAlias string) error
- func (m *ManagerMock) GetByUserJSON(ctx context.Context) ([]byte, error)
- func (m *ManagerMock) GetJSON(ctx context.Context, orgName string) ([]byte, error)
- func (m *ManagerMock) GetMembersJSON(ctx context.Context, orgName string) ([]byte, error)
- func (m *ManagerMock) Update(ctx context.Context, org *hub.Organization) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides an API to manage organizations.
func NewManager ¶
func NewManager(db hub.DB, es hub.EmailSender) *Manager
NewManager creates a new Manager instance.
func (*Manager) AddMember ¶
AddMember adds a new member to the provided organization. The new member must be a registered user. The user will receive an email to confirm her willingness to join the organization. The user doing the request must be a member of the organization.
func (*Manager) CheckAvailability ¶
CheckAvailability checks the availability of a given value for the provided resource kind.
func (*Manager) ConfirmMembership ¶
ConfirmMembership confirms the user doing the request membership to the provided organization.
func (*Manager) DeleteMember ¶
DeleteMember removes a member from the provided organization. The user doing the request must be a member of the organization.
func (*Manager) GetByUserJSON ¶
GetByUserJSON returns the organizations the user doing the request belongs to as a json object.
func (*Manager) GetMembersJSON ¶
GetMembersJSON returns the members of the provided organization as a json object.
type ManagerMock ¶
ManagerMock is a mock implementation of the OrganizationManager interface.
func (*ManagerMock) Add ¶
func (m *ManagerMock) Add(ctx context.Context, org *hub.Organization) error
Add implements the OrganizationManager interface.
func (*ManagerMock) AddMember ¶
func (m *ManagerMock) AddMember(ctx context.Context, orgName, userAlias, baseURL string) error
AddMember implements the OrganizationManager interface.
func (*ManagerMock) CheckAvailability ¶
func (m *ManagerMock) CheckAvailability(ctx context.Context, resourceKind, value string) (bool, error)
CheckAvailability implements the OrganizationManager interface.
func (*ManagerMock) ConfirmMembership ¶
func (m *ManagerMock) ConfirmMembership(ctx context.Context, orgName string) error
ConfirmMembership implements the OrganizationManager interface.
func (*ManagerMock) DeleteMember ¶
func (m *ManagerMock) DeleteMember(ctx context.Context, orgName, userAlias string) error
DeleteMember implements the OrganizationManager interface.
func (*ManagerMock) GetByUserJSON ¶
func (m *ManagerMock) GetByUserJSON(ctx context.Context) ([]byte, error)
GetByUserJSON implements the OrganizationManager interface.
func (*ManagerMock) GetMembersJSON ¶
GetMembersJSON implements the OrganizationManager interface.
func (*ManagerMock) Update ¶
func (m *ManagerMock) Update(ctx context.Context, org *hub.Organization) error
Update implements the OrganizationManager interface.