model

package
v0.0.0-...-4c84fff Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name     string
	DataType string
	DBType   string
}

func NewAttribute

func NewAttribute(name string, dataType string, dbType string) *Attribute

func (*Attribute) GetDBType

func (a *Attribute) GetDBType() string

func (*Attribute) GetName

func (a *Attribute) GetName(private bool) string

func (*Attribute) GetType

func (a *Attribute) GetType() string

func (*Attribute) IsPrimaryKey

func (a *Attribute) IsPrimaryKey() bool

type Cache

type Cache struct {
	Host     string `yaml:"host"`
	Password string `yaml:"password"`
	Db       int    `yaml:"db"`
}

func (*Cache) GetHost

func (c *Cache) GetHost() string

type DB

type DB struct {
	Name    string `yaml:"name"`
	Address string `yaml:"address"`
}

func (DB) GetAddress

func (d DB) GetAddress() string

func (DB) GetName

func (d DB) GetName() string

type Endpoint

type Endpoint struct {
	Name      string    `yaml:"name"`
	Args      []string  `yaml:"args"`
	Output    []string  `yaml:"output"`
	CacheTime int       `yaml:"cache_time"`
	Transport Transport `yaml:"transport"`
}

func (*Endpoint) GetArgs

func (endpoint *Endpoint) GetArgs() []string

func (*Endpoint) GetCacheTime

func (endpoint *Endpoint) GetCacheTime() int

func (*Endpoint) GetName

func (s *Endpoint) GetName() string

func (*Endpoint) GetOutputs

func (endpoint *Endpoint) GetOutputs() []string

func (*Endpoint) GetTransport

func (endpoint *Endpoint) GetTransport() map[string]string

type Model

type Model struct {
	Name             string   `yaml:"name"`
	StringAttributes []string `yaml:"attr"`
	Attributes       []Attribute
}

func (*Model) GetModelAttributes

func (m *Model) GetModelAttributes() []Attribute

func (*Model) GetName

func (m *Model) GetName(private bool) string

type Repository

type Repository struct {
	Value bool `yaml:"value"`
	DB    DB   `yaml:"db"`
}

func (*Repository) GetDB

func (r *Repository) GetDB() DB

type Service

type Service struct {
	Name       string     `yaml:"name"`
	Endpoints  []Endpoint `yaml:"endpoints"`
	Models     []*Model   `yaml:"model"`
	Repository Repository `yaml:"repository"`
	RedisCache Cache      `yaml:"redis_cache"`
	Keys       bool       `yaml:"keys"`
}

func (*Service) Apply

func (s *Service) Apply()

func (*Service) CheckForError

func (s *Service) CheckForError() error

func (*Service) GetInterfaceName

func (s *Service) GetInterfaceName() string

func (*Service) GetServiceName

func (s *Service) GetServiceName() string

func (*Service) GetType

func (s *Service) GetType(in string) string

func (*Service) GetVariableName

func (s *Service) GetVariableName(in string, private bool) string

func (*Service) HasKeys

func (s *Service) HasKeys() bool

func (*Service) IsAddedType

func (s *Service) IsAddedType(typ string) bool

func (*Service) IsArray

func (s *Service) IsArray(typ string) bool

func (*Service) IsNativeType

func (s *Service) IsNativeType(typ string) bool

type Transport

type Transport struct {
	Method string `yaml:"method"`
	Path   string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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