orm

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 5 Imported by: 1

README

Orm

The Orm package is designed to automatically generate repository files

Installation

go get "gitlab.com/golight/orm"

Description

//building genstorage

$ cd cmd
$ install -o genstorage
//parsing file for AST
func ReflectFile(fileName string) ([]ReflectData, error)
//generate methods
func GenerateMethods(filename string) error
func generateMethods(data ReflectData) string
//checking for methods
func methodExists(methods []MethodInfo, structName, methodName string) bool
//append the generated code to the end of the file
func appendToFile(filename, content string) error

Usage

//parsing file name
filename, err = genstorage.GetFileName()
//generate methods from the file
err = GenerateMethods(filename)
//generate the new storage files from the file
storage, err = genstorage.NewStorage(filename)
err = storage.CreateStorageFiles()

Roadmap

  • Tests for GetPackageName, NewStorage, NewStorageTemplate, NewInterfaceTemplate.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOrm

func NewOrm(dbConf params.DB, scanner scanner.Scanner, logger *zap.Logger) (*dao.DAO, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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