service

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(c *di.Container)

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(
	organizationRepository db_organization.Repository,
	organizationMemberRepository db_organization.MemberRepository,
) *Service

func (*Service) AddMember

func (svc *Service) AddMember(ctx context.Context, orgID, userID, addedByUserID string) (*organization.Member, error)

func (*Service) CanAccess

func (svc *Service) CanAccess(ctx context.Context, userID, organizationID string) (bool, error)

func (*Service) Create

func (svc *Service) Create(ctx context.Context, name string) (*organization.Organization, error)

func (*Service) GetByID

func (svc *Service) GetByID(ctx context.Context, organizationID string) (*organization.Organization, error)

func (*Service) GetByShortID

func (*Service) GetFirst

func (svc *Service) GetFirst(ctx context.Context) (*organization.Organization, error)

TODO: Only allow calls to GetFirst from self hosted installations

func (*Service) GetMember

func (svc *Service) GetMember(ctx context.Context, organizationID, userID string) (*organization.Member, error)

func (*Service) GetMemberByUserIDAndOrganizationID

func (svc *Service) GetMemberByUserIDAndOrganizationID(ctx context.Context, userID, organizationID string) (*organization.Member, error)

func (*Service) ListByUserID

func (svc *Service) ListByUserID(ctx context.Context, userID string) ([]*organization.Organization, error)

func (*Service) Members

func (svc *Service) Members(ctx context.Context, organizationID string) ([]*organization.Member, error)

func (*Service) RemoveMember

func (svc *Service) RemoveMember(ctx context.Context, orgID, userID, deletedByUserID string) error

Jump to

Keyboard shortcuts

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