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: 19 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(
	repo db_codebase.CodebaseRepository,
	codebaseUserRepo db_codebase.CodebaseUserRepository,

	workspaceService service_workspace.Service,
	userService service_user.Service,

	logger *zap.Logger,
	executorProvider executor.Provider,
	analyticsClient analytics.Client,
	eventsSender events.EventSender,
) *Service

func (*Service) AddUserByEmail

func (svc *Service) AddUserByEmail(ctx context.Context, codebaseID, email string) (*codebase.CodebaseUser, error)

func (*Service) CanAccess

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

func (*Service) CodebaseCount

func (svc *Service) CodebaseCount(ctx context.Context) (uint64, error)

func (*Service) Create

func (svc *Service) Create(ctx context.Context, name string, organizationID *string) (*codebase.Codebase, error)

func (*Service) GetByID

func (svc *Service) GetByID(_ context.Context, id string) (*codebase.Codebase, error)

func (*Service) GetByShortID

func (svc *Service) GetByShortID(_ context.Context, shortID string) (*codebase.Codebase, error)

func (*Service) ListByOrganization

func (svc *Service) ListByOrganization(ctx context.Context, organizationID string) ([]*codebase.Codebase, error)

func (*Service) ListByOrganizationAndUser

func (svc *Service) ListByOrganizationAndUser(ctx context.Context, organizationID, userID string) ([]*codebase.Codebase, error)

func (*Service) ListOrgsByUser

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

ListOrgsByUser returns a list of organization IDs that the user can _see_ through it's explicit membership of one of it's codebases.

func (*Service) RemoveUser

func (svc *Service) RemoveUser(ctx context.Context, codebaseID, userID string) error

func (*Service) UserIsMemberOfCodebaseInOrganization

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

Jump to

Keyboard shortcuts

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