Categorygithub.com/andiwork/gorm-utils
modulepackage
1.2.0
Repository: https://github.com/andiwork/gorm-utils.git
Documentation: pkg.go.dev

# README

Gorm Utils

go get github.com/andiwork/gorm-utils

Overview

  • model.go : update base gorm.Model with uuid for ID and set update time to now()

Getting Started

gorm-utils.Model

package hello

import (
	utils "github.com/andiwork/gorm-utils"
)

// User is just a sample type
type Person struct {
	utils.Model
	Name string `json:"name" description:"name of the user" default:"john"`
	Age  int    `json:"age" description:"age of the user" default:"21"`
}

License

© J. K. Gaglo, 2021~time.Now

Released under the Apache License Version 2.0

# Structs

Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt It may be embedded into your model or you may build your own model without it type User struct { gorm.Base } https://gorm.io/docs/conventions.html.