neurogonesis

command module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

Neuron Logo

NeuroGonesis (neurogonesis) is the golang based generator for the neuron framework.

NeuroGonesis

is a part of the Neuron framework - github.com/neuronlabs/neuron.

It is a CLI generator that enhances your models with implementing required methods and structures.

Usage

This generator should be used to generate your models methods and database collection access by providing the go:generate comments within your model files.

Models methods

neurogonesis can generate all required methods for the neuron/mapping model interfaces for all your models.

In order to scan and generate paste following command in your models: //go:generate neurogonesis models methods --format=goimports --single-file .

Then execute command go generate within the directory your files are located.

The --single-file flag stores all models methods in the single file.

If you want to scan and generate files only for specified types, use the flag: --type=Type1,Type2 - which would generate model methods only for Type1 and Type2

If you need to exclude some types that might be recognized as a model provide a flag: --exclude=Type1,Type2 which would not tread Type1 and Type2 as models.

The --format=goimports formats file using goimports formatter.

For more information typeneurogonesis models --help .

Collections

Neuron generator can generate Collections for each scanned model. Collections are structures that contains non-interface database model queries as well as customized functions and query builders.

Collections are designed to execute queries easily, without the necessity of interface conversions.

In order to scan and generate paste following command in your models: //go:generate neurogonesis collections --format=goimports --single-file .

Then execute command go generate within the directory your files are located.

The --single-file flag stores all models methods in the single file.

If you want to scan and generate files only for specified types, use the flag: --type=Type1,Type2 - which would generate model collections only for Type1 and Type2

If you need to exclude some types that might be recognized as a model provide a flag: --exclude=Type1,Type2 which would not tread Type1 and Type2 as models.

The --format=goimports formats file using goimports formatter.

For more information typeneurogonesis collections --help .

Documentation

Overview

Copyright © 2020 Jacek Kucharczyk kucjac@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
internal
ast

Jump to

Keyboard shortcuts

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