Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectMongoDb ¶
func Init ¶
func Init(config Configuration)
Types ¶
type Configuration ¶
type Configuration struct { Database DatabaseSetting Server ServerSettings }
type ContactHandler ¶
type ContactHandler interface { GetAllContacts(*gin.Context) GetContactByEmail(*gin.Context) DeleteContact(*gin.Context) HealthCheck(*gin.Context) }
func NewContactHandler ¶
func NewContactHandler(client *mongo.Client, repo ContactRepository) ContactHandler
type ContactRepository ¶
type ContactRepository interface { Get(ctx context.Context) ([]*Contact, error) GetContactByEmail(email string, ctx context.Context) (*Contact, error) Delete(id int, ctx context.Context) (int64, error) }
func NewContactRepository ¶
func NewContactRepository(config *Configuration, client *mongo.Client) ContactRepository
type DatabaseSetting ¶
type ServerSettings ¶
type ServerSettings struct {
Port string
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.