service

package
v0.0.0-...-21f8c24 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleService

type GoogleService interface {
	ServiceAccountCredentialsExistsForTenant(ctx context.Context, tenant string) (bool, error)

	GetGmailService(ctx context.Context, username, tenant string) (*gmail.Service, error)

	GetGmailServiceWithServiceAccount(ctx context.Context, username string, tenant string) (*gmail.Service, error)
	GetGCalServiceWithServiceAccount(ctx context.Context, username string, tenant string) (*calendar.Service, error)

	GetGmailServiceWithOauthToken(ctx context.Context, tokenEntity authEntity.OAuthTokenEntity) (*gmail.Service, error)
	GetGCalServiceWithOauthToken(ctx context.Context, tokenEntity authEntity.OAuthTokenEntity) (*calendar.Service, error)
}

func NewGoogleService

func NewGoogleService(cfg *config.Config, postgresRepositories *postgresRepository.Repositories, authRepositories *authRepository.Repositories, services *Services) GoogleService

type OAuthTokenService

type OAuthTokenService interface {
	Save(ctx context.Context, tokenEntity entity.OAuthTokenEntity) (*entity.OAuthTokenEntity, error)
	GetByPlayerIdAndProvider(ctx context.Context, playerId string, provider string) (*entity.OAuthTokenEntity, error)
	DeleteByPlayerIdAndProvider(ctx context.Context, playerId string, provider string) error
}

func NewOAuthTokenService

func NewOAuthTokenService(repositories *repository.Repositories) OAuthTokenService

type Services

type Services struct {
	CommonServices *commonService.Services

	CommonAuthRepositories *repository.Repositories
	OAuthTokenService      OAuthTokenService
	GoogleService          GoogleService
}

func InitServices

func InitServices(cfg *config.Config, commonServices *commonService.Services, db *gorm.DB) *Services

Jump to

Keyboard shortcuts

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