services

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MPL-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSubscriptionNotFound         = errors.New("subscription not found")
	ErrUpateSubscriptionError       = errors.New("failed to update subscription")
	ErrCreateSubscriptionError      = errors.New("failed to create subscription")
	ErrDeletedSubscriptionError     = errors.New("failed to delete subscription")
	ErrValidateSubscriptionError    = errors.New("failed to validate group update")
	ErrCannotFetchSubcriptionsError = errors.New("an error occurred while fetching subscriptions")
)
View Source
var ErrInvalidEventDeliveryStatus = errors.New("only successful events can be force resent")

Functions

This section is empty.

Types

type AppService

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

func NewAppService

func NewAppService(appRepo datastore.ApplicationRepository, eventRepo datastore.EventRepository, eventDeliveryRepo datastore.EventDeliveryRepository, cache cache.Cache) *AppService

func (*AppService) CountGroupApplications added in v0.6.2

func (a *AppService) CountGroupApplications(ctx context.Context, groupID string) (int64, error)

func (*AppService) CreateApp

func (*AppService) CreateAppEndpoint

func (a *AppService) CreateAppEndpoint(ctx context.Context, e models.Endpoint, app *datastore.Application) (*datastore.Endpoint, error)

func (*AppService) DeleteAppEndpoint

func (a *AppService) DeleteAppEndpoint(ctx context.Context, e *datastore.Endpoint, app *datastore.Application) error

func (*AppService) DeleteApplication

func (a *AppService) DeleteApplication(ctx context.Context, app *datastore.Application) error

func (*AppService) LoadApplicationsPaged

func (a *AppService) LoadApplicationsPaged(ctx context.Context, uid string, q string, pageable datastore.Pageable) ([]datastore.Application, datastore.PaginationData, error)

func (*AppService) UpdateAppEndpoint

func (a *AppService) UpdateAppEndpoint(ctx context.Context, e models.Endpoint, endPointId string, app *datastore.Application) (*datastore.Endpoint, error)

func (*AppService) UpdateApplication

func (a *AppService) UpdateApplication(ctx context.Context, appUpdate *models.UpdateApplication, app *datastore.Application) error

type ConfigService added in v0.6.0

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

func NewConfigService added in v0.6.0

func NewConfigService(configRepo datastore.ConfigurationRepository) *ConfigService

func (*ConfigService) CreateConfiguration added in v0.6.0

func (c *ConfigService) CreateConfiguration(ctx context.Context, newConfig *models.Configuration) (*datastore.Configuration, error)

func (*ConfigService) LoadConfiguration added in v0.6.0

func (c *ConfigService) LoadConfiguration(ctx context.Context) (*datastore.Configuration, error)

func (*ConfigService) UpdateConfiguration added in v0.6.0

func (c *ConfigService) UpdateConfiguration(ctx context.Context, config *models.Configuration) (*datastore.Configuration, error)

type EventService

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

func (*EventService) BatchRetryEventDelivery

func (e *EventService) BatchRetryEventDelivery(ctx context.Context, filter *datastore.Filter) (int, int, error)

func (*EventService) CountAffectedEventDeliveries

func (e *EventService) CountAffectedEventDeliveries(ctx context.Context, filter *datastore.Filter) (int64, error)

func (*EventService) CreateAppEvent

func (e *EventService) CreateAppEvent(ctx context.Context, newMessage *models.Event, g *datastore.Group) (*datastore.Event, error)

func (*EventService) ForceResendEventDeliveries

func (e *EventService) ForceResendEventDeliveries(ctx context.Context, ids []string, g *datastore.Group) (int, int, error)

func (*EventService) GetAppEvent

func (e *EventService) GetAppEvent(ctx context.Context, id string) (*datastore.Event, error)

func (*EventService) GetEventDeliveriesPaged

func (e *EventService) GetEventDeliveriesPaged(ctx context.Context, filter *datastore.Filter) ([]datastore.EventDelivery, datastore.PaginationData, error)

func (*EventService) GetEventDelivery

func (e *EventService) GetEventDelivery(ctx context.Context, id string) (*datastore.EventDelivery, error)

func (*EventService) GetEventsPaged

func (e *EventService) GetEventsPaged(ctx context.Context, filter *datastore.Filter) ([]datastore.Event, datastore.PaginationData, error)

func (*EventService) ReplayAppEvent added in v0.6.0

func (e *EventService) ReplayAppEvent(ctx context.Context, event *datastore.Event, g *datastore.Group) error

func (*EventService) ResendEventDelivery

func (e *EventService) ResendEventDelivery(ctx context.Context, eventDelivery *datastore.EventDelivery, g *datastore.Group) error

func (*EventService) RetryEventDelivery

func (e *EventService) RetryEventDelivery(ctx context.Context, eventDelivery *datastore.EventDelivery, g *datastore.Group) error

func (*EventService) Search added in v0.6.0

type GroupService

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

func (*GroupService) CreateGroup

func (*GroupService) DeleteGroup

func (gs *GroupService) DeleteGroup(ctx context.Context, id string) error

func (*GroupService) FillGroupsStatistics added in v0.6.0

func (gs *GroupService) FillGroupsStatistics(ctx context.Context, groups []*datastore.Group) error

func (*GroupService) GetGroups

func (gs *GroupService) GetGroups(ctx context.Context, filter *datastore.GroupFilter) ([]*datastore.Group, error)

func (*GroupService) UpdateGroup

func (gs *GroupService) UpdateGroup(ctx context.Context, group *datastore.Group, update *models.UpdateGroup) (*datastore.Group, error)

type OrganisationInviteService added in v0.6.0

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

func (*OrganisationInviteService) CancelOrganisationMemberInvite added in v0.6.0

func (ois *OrganisationInviteService) CancelOrganisationMemberInvite(ctx context.Context, inviteID string) (*datastore.OrganisationInvite, error)

func (*OrganisationInviteService) CreateOrganisationMemberInvite added in v0.6.0

func (ois *OrganisationInviteService) CreateOrganisationMemberInvite(ctx context.Context, newIV *models.OrganisationInvite, org *datastore.Organisation, user *datastore.User, baseURL string) (*datastore.OrganisationInvite, error)

func (*OrganisationInviteService) FindUserByInviteToken added in v0.6.0

func (ois *OrganisationInviteService) FindUserByInviteToken(ctx context.Context, token string) (*datastore.User, *datastore.OrganisationInvite, error)

func (*OrganisationInviteService) LoadOrganisationInvitesPaged added in v0.6.0

func (*OrganisationInviteService) ProcessOrganisationMemberInvite added in v0.6.0

func (ois *OrganisationInviteService) ProcessOrganisationMemberInvite(ctx context.Context, token string, accepted bool, newUser *models.User) error

func (*OrganisationInviteService) ResendOrganisationMemberInvite added in v0.6.0

func (ois *OrganisationInviteService) ResendOrganisationMemberInvite(ctx context.Context, inviteID string, org *datastore.Organisation, user *datastore.User, baseURL string) (*datastore.OrganisationInvite, error)

type OrganisationMemberService added in v0.6.0

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

func NewOrganisationMemberService added in v0.6.0

func NewOrganisationMemberService(orgMemberRepo datastore.OrganisationMemberRepository) *OrganisationMemberService

func (*OrganisationMemberService) CreateOrganisationMember added in v0.6.0

func (om *OrganisationMemberService) CreateOrganisationMember(ctx context.Context, org *datastore.Organisation, user *datastore.User, role *auth.Role) (*datastore.OrganisationMember, error)

func (*OrganisationMemberService) DeleteOrganisationMember added in v0.6.0

func (om *OrganisationMemberService) DeleteOrganisationMember(ctx context.Context, memberID string, org *datastore.Organisation) error

func (*OrganisationMemberService) FindOrganisationMemberByID added in v0.6.0

func (om *OrganisationMemberService) FindOrganisationMemberByID(ctx context.Context, org *datastore.Organisation, id string) (*datastore.OrganisationMember, error)

func (*OrganisationMemberService) LoadOrganisationMembersPaged added in v0.6.0

func (*OrganisationMemberService) UpdateOrganisationMember added in v0.6.0

func (om *OrganisationMemberService) UpdateOrganisationMember(ctx context.Context, organisationMember *datastore.OrganisationMember, role *auth.Role) (*datastore.OrganisationMember, error)

type OrganisationService added in v0.6.0

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

func NewOrganisationService added in v0.6.0

func NewOrganisationService(orgRepo datastore.OrganisationRepository, orgMemberRepo datastore.OrganisationMemberRepository) *OrganisationService

func (*OrganisationService) CreateOrganisation added in v0.6.0

func (os *OrganisationService) CreateOrganisation(ctx context.Context, newOrg *models.Organisation, user *datastore.User) (*datastore.Organisation, error)

func (*OrganisationService) DeleteOrganisation added in v0.6.0

func (os *OrganisationService) DeleteOrganisation(ctx context.Context, id string) error

func (*OrganisationService) FindOrganisationByID added in v0.6.0

func (os *OrganisationService) FindOrganisationByID(ctx context.Context, id string) (*datastore.Organisation, error)

func (*OrganisationService) LoadOrganisationsPaged added in v0.6.0

func (os *OrganisationService) LoadOrganisationsPaged(ctx context.Context, pageable datastore.Pageable) ([]datastore.Organisation, datastore.PaginationData, error)

func (*OrganisationService) LoadUserOrganisationsPaged added in v0.6.0

func (os *OrganisationService) LoadUserOrganisationsPaged(ctx context.Context, user *datastore.User, pageable datastore.Pageable) ([]datastore.Organisation, datastore.PaginationData, error)

func (*OrganisationService) UpdateOrganisation added in v0.6.0

type SecurityService

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

func NewSecurityService

func NewSecurityService(groupRepo datastore.GroupRepository, apiKeyRepo datastore.APIKeyRepository) *SecurityService

func (*SecurityService) CreateAPIKey

func (ss *SecurityService) CreateAPIKey(ctx context.Context, member *datastore.OrganisationMember, newApiKey *models.APIKey) (*datastore.APIKey, string, error)

func (*SecurityService) CreateAppPortalAPIKey

func (ss *SecurityService) CreateAppPortalAPIKey(ctx context.Context, group *datastore.Group, app *datastore.Application, baseUrl *string) (*datastore.APIKey, string, error)

func (*SecurityService) GetAPIKeyByID

func (ss *SecurityService) GetAPIKeyByID(ctx context.Context, uid string) (*datastore.APIKey, error)

func (*SecurityService) GetAPIKeys

func (*SecurityService) RevokeAPIKey

func (ss *SecurityService) RevokeAPIKey(ctx context.Context, uid string) error

func (*SecurityService) UpdateAPIKey

func (ss *SecurityService) UpdateAPIKey(ctx context.Context, uid string, role *auth.Role) (*datastore.APIKey, error)

type SourceService added in v0.6.0

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

func NewSourceService added in v0.6.0

func NewSourceService(sourceRepo datastore.SourceRepository, cache cache.Cache) *SourceService

func (*SourceService) CreateSource added in v0.6.0

func (s *SourceService) CreateSource(ctx context.Context, newSource *models.Source, g *datastore.Group) (*datastore.Source, error)

func (*SourceService) DeleteSource added in v0.6.0

func (s *SourceService) DeleteSource(ctx context.Context, g *datastore.Group, source *datastore.Source) error

func (*SourceService) FindSourceByID added in v0.6.0

func (s *SourceService) FindSourceByID(ctx context.Context, g *datastore.Group, id string) (*datastore.Source, error)

func (*SourceService) FindSourceByMaskID added in v0.6.2

func (s *SourceService) FindSourceByMaskID(ctx context.Context, maskID string) (*datastore.Source, error)

func (*SourceService) LoadSourcesPaged added in v0.6.0

func (*SourceService) UpdateSource added in v0.6.0

func (s *SourceService) UpdateSource(ctx context.Context, g *datastore.Group, sourceUpdate *models.UpdateSource, source *datastore.Source) (*datastore.Source, error)

type SubcriptionService added in v0.6.0

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

func NewSubscriptionService added in v0.6.0

func (*SubcriptionService) CreateSubscription added in v0.6.0

func (s *SubcriptionService) CreateSubscription(ctx context.Context, group *datastore.Group, newSubscription *models.Subscription) (*datastore.Subscription, error)

func (*SubcriptionService) DeleteSubscription added in v0.6.0

func (s *SubcriptionService) DeleteSubscription(ctx context.Context, groupId string, subscription *datastore.Subscription) error

func (*SubcriptionService) FindSubscriptionByID added in v0.6.0

func (s *SubcriptionService) FindSubscriptionByID(ctx context.Context, group *datastore.Group, subscriptionId string, skipCache bool) (*datastore.Subscription, error)

func (*SubcriptionService) LoadSubscriptionsPaged added in v0.6.0

func (*SubcriptionService) ToggleSubscriptionStatus added in v0.6.0

func (s *SubcriptionService) ToggleSubscriptionStatus(ctx context.Context, groupId string, subscriptionId string) (*datastore.Subscription, error)

func (*SubcriptionService) UpdateSubscription added in v0.6.0

func (s *SubcriptionService) UpdateSubscription(ctx context.Context, groupId string, subscriptionId string, update *models.UpdateSubscription) (*datastore.Subscription, error)

type UserService added in v0.6.0

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

func NewUserService added in v0.6.0

func NewUserService(userRepo datastore.UserRepository, cache cache.Cache, queue queue.Queuer, configService *ConfigService, orgService *OrganisationService) *UserService

func (*UserService) GeneratePasswordResetToken added in v0.6.0

func (u *UserService) GeneratePasswordResetToken(ctx context.Context, baseURL string, data *models.ForgotPassword) error

func (*UserService) LoginUser added in v0.6.0

func (u *UserService) LoginUser(ctx context.Context, data *models.LoginUser) (*datastore.User, *jwt.Token, error)

func (*UserService) LogoutUser added in v0.6.0

func (u *UserService) LogoutUser(token string) error

func (*UserService) RefreshToken added in v0.6.0

func (u *UserService) RefreshToken(ctx context.Context, data *models.Token) (*jwt.Token, error)

func (*UserService) RegisterUser added in v0.6.5

func (u *UserService) RegisterUser(ctx context.Context, data *models.RegisterUser) (*datastore.User, *jwt.Token, error)

func (*UserService) ResetPassword added in v0.6.0

func (u *UserService) ResetPassword(ctx context.Context, token string, data *models.ResetPassword) (*datastore.User, error)

func (*UserService) UpdatePassword added in v0.6.0

func (u *UserService) UpdatePassword(ctx context.Context, data *models.UpdatePassword, user *datastore.User) (*datastore.User, error)

func (*UserService) UpdateUser added in v0.6.0

func (u *UserService) UpdateUser(ctx context.Context, data *models.UpdateUser, user *datastore.User) (*datastore.User, error)

Jump to

Keyboard shortcuts

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