elk

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 0 Imported by: 1

README

elk

This package aims to generated fully functional code for the basic crud operations on a defined set of entities. It relies heavily on facebook/ent.

elk is meant to be used as drop-in replacement of the provided entc command of the facebook/ent package.

This is work in progress: The API may change without further notice!

Usage examples

Generate the entity graph (similar to entc generate):

elk generate

Generate crud handlers for the entities:

elk generate handler

Generate dart models (to use in flutter):

elk generate flutter

Documentation

Overview

Copyright © 2020 MasseElch <info@masseelch.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	OrderASC  = "asc"
	OrderDESC = "desc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EdgeAnnotation

type EdgeAnnotation struct {
	DefaultOrder []Order
}

Used on (list) edges to specify a default order.

func (EdgeAnnotation) Name

func (EdgeAnnotation) Name() string

type FieldAnnotation

type FieldAnnotation struct {
	SkipCreate          bool
	CreateValidationTag string
	SkipUpdate          bool
	UpdateValidationTag string
	MapGoType           bool
}

Used on fields pass options to the handler generator.

func (FieldAnnotation) Name

func (FieldAnnotation) Name() string

type HandlerAnnotation

type HandlerAnnotation struct {
	Skip             bool
	SkipCreate       bool
	SkipRead         bool
	SkipUpdate       bool
	SkipDelete       bool
	SkipList         bool
	CreateGroups     []string
	ReadGroups       []string
	UpdateGroups     []string
	ListGroups       []string
	DefaultListOrder []Order
}

Used on a schema to pass options to the handler generator.

func (HandlerAnnotation) Name

func (HandlerAnnotation) Name() string

type Order

type Order struct {
	Order string
	Field string
}

Directories

Path Synopsis
cmd
elk
Package internal Code generated by go-bindata.
Package internal Code generated by go-bindata.
pkg
gen

Jump to

Keyboard shortcuts

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