config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFilePath   = ".eevee.yml"
	DefaultDataStore = "db"
)

Variables

This section is empty.

Functions

func ExistsConfig

func ExistsConfig() bool

func WriteConfig

func WriteConfig(cfg *Config) error

Types

type Config

type Config struct {
	ModulePath   string             `yaml:"module"`
	ClassPath    string             `yaml:"class,omitempty"`
	APIPath      string             `yaml:"api,omitempty"`
	SchemaPath   string             `yaml:"schema,omitempty"`
	GraphPath    string             `yaml:"graph,omitempty"`
	DocumentPath string             `yaml:"document,omitempty"`
	OutputPath   string             `yaml:"output,omitempty"`
	Plugins      map[string]*Plugin `yaml:"plugins,omitempty"`
	DAO          *DAO               `yaml:"dao,omitempty"`
	Entity       *Entity            `yaml:"entity,omitempty"`
	Model        *Model             `yaml:"model,omitempty"`
	Repository   *Repository        `yaml:"repository,omitempty"`
	Renderer     *Renderer          `yaml:"renderer,omitempty"`
	Plural       []*Plural          `yaml:"plural,omitempty"`
	Context      *Context           `yaml:"context,omitempty"`
	Types        []*PrimitiveType   `yaml:"primitive_types,omitempty"`
}

func ConfigFromBytes

func ConfigFromBytes(bytes []byte) (*Config, error)

func ConfigFromPath

func ConfigFromPath(path string) (*Config, error)

func ConfigFromReader

func ConfigFromReader(r io.Reader) (*Config, error)

func ReadConfig

func ReadConfig() (*Config, error)

func (*Config) ContextImportPath

func (cfg *Config) ContextImportPath() string

func (*Config) DAOPackageName

func (cfg *Config) DAOPackageName() string

func (*Config) DataStore

func (cfg *Config) DataStore() string

func (*Config) EntityPackageName

func (cfg *Config) EntityPackageName() string

func (*Config) EntityPlugins

func (cfg *Config) EntityPlugins() []string

func (*Config) ModelPackageName

func (cfg *Config) ModelPackageName() string

func (*Config) OutputPathWithPackage

func (cfg *Config) OutputPathWithPackage(pkg string) string

func (*Config) RepositoryPackageName

func (cfg *Config) RepositoryPackageName() string

func (*Config) RequestPackageName

func (cfg *Config) RequestPackageName() string

func (*Config) ResponsePackageName

func (cfg *Config) ResponsePackageName() string

func (*Config) TestDataPath

func (cfg *Config) TestDataPath() string

type Context

type Context struct {
	Import string `yaml:"import"`
}

type DAO

type DAO struct {
	Name      string                `yaml:"name,omitempty"`
	Default   string                `yaml:"default,omitempty"`
	DataStore map[string]*DataStore `yaml:"datastore,omitempty"`
}

type DataStore

type DataStore struct {
	Hooks map[string]interface{}
}

func (*DataStore) UnmarshalYAML

func (s *DataStore) UnmarshalYAML(unmarshal func(interface{}) error) error

type Entity

type Entity struct {
	Name    string   `yaml:"name,omitempty"`
	Plugins []string `yaml:"plugins,omitempty"`
}

type Model

type Model struct {
	Name string `yaml:"name,omitempty"`
}

type Plugin

type Plugin struct {
	Name    string `yaml:"-"`
	Repo    string `yaml:"repo"`
	Version string `yaml:"version"`
}

type Plural

type Plural struct {
	Name string `yaml:"name"`
	One  string `yaml:"one"`
}

type PrimitiveType

type PrimitiveType struct {
	Name         string      `yaml:"name"`
	PackageName  string      `yaml:"package_name"`
	Import       string      `yaml:"import"`
	DefaultValue interface{} `yaml:"default"`
	As           string      `yaml:"as"`
}

type RenderStyle

type RenderStyle string
const (
	RenderStyleLowerCamel RenderStyle = "lower-camel"
	RenderStyleUpperCamel RenderStyle = "upper-camel"
	RenderStyleLowerSnake RenderStyle = "lower-snake"
)

type Renderer

type Renderer struct {
	Style RenderStyle `yaml:"style,omitempty"`
}

type Repository

type Repository struct {
	Name string `yaml:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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