Documentation ¶
Overview ¶
Package initsrv will contain all initialization of the required service, repository and handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitHandler ¶
func InitHandler(ctx context.Context, c *HandlerConfig)
InitHandler will initialize all handler that will be used in the application
Types ¶
type Client ¶
type Client struct { Mailer *mailgun.MailgunImpl Discord *discordgo.Session Redis *redis.Client MariaDB *ent.Client }
Client will hold client that will be injected into the Service layer on service initialization
func InitClient ¶
InitClient will initialize all client
type HandlerConfig ¶
type HandlerConfig struct { Logger *otelzap.Logger Conf *configs.Config Router *gin.Engine Service *Service }
HandlerConfig will hold parameter that will be injected into handler
type Repository ¶
type Repository struct { Token *tokenrepo.Repository Mailer *mailerrepo.Repository Admin *adminrepo.AtomicRepository Student *studentrepo.AtomicRepository }
Repository will hold repository that will be injected into this Service layer on service initialization
func InitRepository ¶
func InitRepository(conf *Client) *Repository
InitRepository will initialize all repository
type Service ¶
type Service struct { Student studentservice.Interface Mailer mailerservice.Interface Token tokenservice.Interface Admin adminservice.Interface }
Service will hold service that will be injected into this Handdler layer on handler initialization
func InitService ¶
func InitService(c *ServiceConfig) *Service
InitService will initialize all service needed by application
type ServiceConfig ¶
type ServiceConfig struct { Logger *otelzap.Logger Conf *configs.Config Repo *Repository Utils *UtilsConfig }
ServiceConfig contain parameter that will be injected into Service layer
type UtilsConfig ¶
type UtilsConfig struct {
Certs *configs.JWTCertificate
}
UtilsConfig will hold utils that will be injected into Service layer on service initialization