options

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments []string

func (Arguments) IsHelp

func (a Arguments) IsHelp() bool

func (Arguments) IsLegacy

func (a Arguments) IsLegacy() bool

func (Arguments) SubMode

func (a Arguments) SubMode() bool

type Auth added in v0.9.0

type Auth struct {
	HMAC     string     `short:"A" long:"jwtHMAC" description:"HMACKeyPath|EncKey" `
	RSA      string     `short:"J" long:"jwtRSA" description:"PublicKeyPath|EncKey" `
	Firebase string     `short:"F" long:"fsecret" description:"Firebase secrets" `
	Custom   CustomAuth `short:"E" long:"customAuth" description:"Custom AuthSQL" `
}

func (*Auth) Init added in v0.9.0

func (v *Auth) Init()

type Build

type Build struct {
	GoBuild
	LdFlags *string `short:"f" long:"ldflags" description:"build ldflags"`
	Runtime string  `short:"r" long:"runtime" description:"runtime binary" choice:"standalone" choice:"lambda/url" choice:"lambda/apigw"`
}

func (*Build) Init

func (b *Build) Init() error

type Bundle

type Bundle struct {
	Source   string `short:"s" long:"src" description:"datly rule repository " `
	RuleDest string `short:"d" long:"dest" description:"datly rule repository rewrite deployment dest ie.: s3://vaint-e2e-config/datly-xxx/" `
}

func (*Bundle) Init

func (b *Bundle) Init() error

type CacheProvider

type CacheProvider struct {
	Location     string `short:"l" long:"cloc" description:"cache location" default:"${view.Name}" `
	Name         string `short:"n" long:"cname" description:"cache name" default:"aero" `
	ProviderURL  string `short:"u" long:"curl" description:"cache provider url" `
	TimeToLiveMs int    `short:"t" long:"cttl"  description:"cache time to live ms" default:"3600000"`
}

func (CacheProvider) Init

func (c CacheProvider) Init() error

type CacheWarmup

type CacheWarmup struct {
	URIs []string `short:"u" long:"wuri" description:"uri to warmup cache" `
	Run
}

type ConfigURL

type ConfigURL string

func (ConfigURL) Repository

func (c ConfigURL) Repository() string

type ConfigURLs

type ConfigURLs []ConfigURL

func (*ConfigURLs) Append

func (c *ConfigURLs) Append(URL string)

func (ConfigURLs) Repository

func (c ConfigURLs) Repository() string

func (ConfigURLs) URL

func (c ConfigURLs) URL() string

func (ConfigURLs) URLs

func (c ConfigURLs) URLs() []string

type Connector

type Connector struct {
	Connectors []string `short:"c" long:"conn" description:"name|driver|dsn|secretUrl|key" `
}

func (*Connector) Init

func (c *Connector) Init()

type CustomAuth added in v0.9.0

type CustomAuth string

func (*CustomAuth) ShiftInt added in v0.9.0

func (c *CustomAuth) ShiftInt() (int, error)

func (*CustomAuth) ShiftString added in v0.9.0

func (c *CustomAuth) ShiftString() string

func (*CustomAuth) Size added in v0.9.0

func (c *CustomAuth) Size() int

type Datly

type Datly struct {
	Location string `short:"x" long:"dsrc" description:"datly location" default:".build"`
	Tag      string `short:"t" long:"tag" description:" datly tag"`
}

type Extension

type Extension struct {
	Project string `short:"p" long:"proj" description:"destination project"`
	Module
	Datly
}

func (*Extension) GoModInitArgs

func (e *Extension) GoModInitArgs(shared *Module) []string

func (*Extension) Init

func (e *Extension) Init(ctx context.Context) error

func (*Extension) PackageLocation

func (e *Extension) PackageLocation() string

func (*Extension) Replacer

func (e *Extension) Replacer(shared *Module) data.Map

type Generate

type Generate struct {
	Repository
	Rule
	Dest           string `short:"d" long:"dest" description:"dql file location" default:"dql"`
	Operation      string `short:"o" long:"op" description:"operation" choice:"post" choice:"patch" choice:"put" choice:"get"`
	Kind           string `short:"k" long:"kind" description:"execution kind" choice:"dml" choice:"service"`
	Lang           string `short:"l" long:"lang" description:"lang" choice:"velty" choice:"go"`
	Translate      bool   `short:"t" long:"translate" description:"translate generated DSQL"`
	NoComponentDef bool   `short:"Z" long:"noComDef" description:"do not include component definition" `
}

func (*Generate) DSQLLocation

func (g *Generate) DSQLLocation() string

func (*Generate) EmbedLocation

func (g *Generate) EmbedLocation(URI string, methodFragment string) string

func (*Generate) EntityLocation

func (g *Generate) EntityLocation(prefix, methodFragment, entityName string) string

func (*Generate) HandlerLocation

func (g *Generate) HandlerLocation(prefix string, methodFragment string) string

func (*Generate) HandlerType

func (g *Generate) HandlerType(methodFragment string) string

func (*Generate) HttpMethod

func (g *Generate) HttpMethod() string

func (*Generate) IndexLocation

func (g *Generate) IndexLocation(prefix string, methodFragment string) string

func (*Generate) Init

func (g *Generate) Init() error

func (*Generate) InitLocation

func (g *Generate) InitLocation(prefix string, methodFragment string) string

func (*Generate) InputLocation

func (g *Generate) InputLocation(prefix string, methodFragment string) string

func (*Generate) InputType

func (g *Generate) InputType(methodFragment string) string

func (*Generate) OutputLocation

func (g *Generate) OutputLocation(prefix string, methodFragment string) string

func (*Generate) OutputType

func (g *Generate) OutputType(methodFragment string) string

type GoBuild

type GoBuild struct {
	Project   string   `short:"p" long:"proj" description:"project"`
	Module    string   `short:"m" long:"module" description:"custom go module location" default:"pkg" `
	Extension string   `short:"e" long:"ext" description:"extension replace project" default:".build/ext"`
	Datly     string   `short:"l" long:"xdatly" description:"custom extended datly location" default:".build/datly"`
	MainPath  string   `short:"M" long:"main" description:"main path"`
	Name      string   `short:"n" long:"name" description:"git module name" `
	Source    []string `short:"s" long:"source" description:"source locations"`
	DestURL   string   `short:"d" long:"dest" description:"dest location"`
	BuildArgs []string `short:"b" long:"buildArgs" description:"build args"`
	GoVersion string   `short:"v"  long:"goVer" description:"build go Version"`
	GoOs      string   `short:"o" long:"goOs" description:"plugin OS"`
	GoArch    string   `short:"a" long:"goArch" description:"plugin ARCH"`
	GoPath    string   `short:"P" long:"goPath" description:"go path"`
	GoRoot    string   `short:"R" long:"goRoot" description:"go root"`
}

func (*GoBuild) Init

func (b *GoBuild) Init()

type Init

type Init struct {
	Project string `short:"p" long:"proj" description:"project location"`
	Repository
	CacheProvider
}

func (*Init) Init

func (i *Init) Init(ctx context.Context) error

type Mbus

type Mbus struct {
	MBuses []string `short:"b" long:"mbus" description:"name|vendor|resourceType|uri[|region|secretURL|secretKey]" `
}

func (*Mbus) Init

func (c *Mbus) Init()

type Module

type Module struct {
	GitRepository *string `short:"g" long:"gitrepo" description:"git module repo"`
	GitFolder     *string
	GitPrivate    *string `short:"T" long:"gitprivate" description:"git private"`
	Name          string  `short:"n" long:"name" description:"module name" `
}

func (*Module) Module

func (e *Module) Module() string

type Options

type Options struct {
	InitExt   *Extension   `command:"initExt" description:"initialises datly extension project" `
	Build     *Build       `command:"build" description:"build custom datly binary"  `
	Plugin    *Plugin      `command:"plugin" description:"build custom datly rule plugin"  `
	Generate  *Generate    `command:"gen" description:"generate dql for put,patch or post operation" `
	Translate *Translate   `command:"translate" description:"translate dql into datly repository rule"`
	Cache     *CacheWarmup `command:"cache" description:"warmup cache"`
	Run       *Run         `command:"run" description:"start datly in standalone mode"`
	Bundle    *Bundle      `command:"bundle" description:"bundles rules for cloud deployment (speed/cost optimization)"`
	InitCmd   *Init        `command:"init" description:"init datly rule repository"`
	Touch     *Touch       `command:"touch" description:"forces route rule sync"`
	Version   bool         `short:"v" long:"version" description:"datly version" `
}

func NewOptions

func NewOptions(args Arguments) *Options

func (*Options) ConfigURLs

func (o *Options) ConfigURLs() []string

func (*Options) Connectors

func (o *Options) Connectors() []string

func (*Options) Init

func (o *Options) Init(ctx context.Context) error

func (*Options) Repository

func (o *Options) Repository() *Repository

func (*Options) Rule

func (o *Options) Rule() *Rule

func (*Options) ShallTranslate

func (o *Options) ShallTranslate() bool

func (*Options) UpdateTranslate

func (o *Options) UpdateTranslate()

type Plugin

type Plugin struct {
	GoBuild
	Repository string `short:"r" long:"repo" description:"rule repository location"`
}

func (*Plugin) Init

func (p *Plugin) Init() error

func (*Plugin) IsRepositoryPlugin

func (p *Plugin) IsRepositoryPlugin() bool

func (*Plugin) RouteURL

func (p *Plugin) RouteURL() string

func (*Plugin) Touch

func (p *Plugin) Touch() *Touch

type Repository

type Repository struct {
	Connector
	Mbus
	Auth
	ProjectURL           string
	RepositoryURL        string     `short:"r" long:"repo" description:"datly rule repository location"  default:"repo/dev" `
	ConstURL             string     `short:"O" long:"const" description:"const location" `
	SubstitutesURL       []string   `short:"S" long:"subs" description:"substitutes location" `
	Profile              string     `short:"X" long:"profile" description:"substitutes profile" `
	Port                 *int       `short:"P" long:"port" description:"endpoint port" `
	APIPrefix            string     `short:"a" long:"api" description:"api prefix"  default:"/v1/api" `
	Configs              ConfigURLs `short:"C" long:"config" description:"config url" `
	CacheConnectorPrefix string     `short:"H" long:"cprefix" description:"cache prefix"`
	LoadPlugin           bool       `short:"L" long:"lplugin" description:"load plugin"`
}

func (*Repository) Init

func (r *Repository) Init(ctx context.Context, project string) error

type Router

type Router struct {
	RouterURL string `json:",omitempty" yaml:",omitempty"`
	URL       string `json:",omitempty" yaml:",omitempty"`
	Routes    []struct {
		SourceURL string
	}
}

type Rule

type Rule struct {
	Project        string   `short:"p" long:"proj" description:"project location"`
	Name           string   `short:"n" long:"name" description:"rule name"`
	ModulePrefix   string   `short:"u" long:"namespace" description:"rule uri/namespace"  default:"dev" `
	Source         []string `short:"s" long:"src" description:"source"`
	Packages       []string `short:"g" long:"pkg" description:"entity package"`
	Output         []string
	Index          int
	ModuleLocation string `short:"m" long:"module" description:"go module package root" default:"pkg"`

	Generated   bool
	SkipCompDef bool `short:"B" long:"sComp" description:"skip component def"`
	// contains filtered or unexported fields
}

func (*Rule) BaseRuleURL

func (r *Rule) BaseRuleURL() string

func (*Rule) ComponentPath added in v0.9.8

func (r *Rule) ComponentPath() string

func (*Rule) GoCodeLocation

func (r *Rule) GoCodeLocation() string

func (*Rule) GoModuleLocation

func (r *Rule) GoModuleLocation() string

func (*Rule) ImportPackage

func (r *Rule) ImportPackage() string

func (*Rule) ImportType

func (r *Rule) ImportType(aType string) string

func (*Rule) Init

func (r *Rule) Init() error

func (*Rule) LoadSource

func (r *Rule) LoadSource(ctx context.Context, fs afs.Service, URL string) (string, error)

func (*Rule) ModFileLocation

func (r *Rule) ModFileLocation(ctx context.Context) string

func (*Rule) Module added in v0.9.8

func (r *Rule) Module() (*modfile.Module, error)

Module returns go module

func (*Rule) NormalizeComponent

func (r *Rule) NormalizeComponent(dSQL *string)

func (*Rule) NormalizeSQL

func (r *Rule) NormalizeSQL(SQL string, option func() sqlparser.Option) string

func (*Rule) Package

func (r *Rule) Package() string

func (*Rule) RuleName

func (r *Rule) RuleName() string

func (*Rule) SourceDirectory

func (r *Rule) SourceDirectory() string

func (*Rule) SourceURL

func (r *Rule) SourceURL() string

type Run

type Run struct {
	ConfigURL    string   `short:"c" long:"conf" description:"datly config"`
	WarmupURIs   []string `short:"w" long:"warmup" description:"warmup uris"`
	JobURL       string   `short:"z" long:"joburl" description:"job url"`
	MaxJobs      int      `short:"W" long:"mjobs" description:"max jobs" default:"40" `
	FailedJobURL string   `short:"F" long:"fjobs" description:"failed jobs" `
	LoadPlugin   bool     `short:"L" long:"lplugin" description:"load plugin"`
	PluginInfo   string
}

func (*Run) Init

func (r *Run) Init() error

type Touch

type Touch struct {
	Repo      string `short:"r" long:"repo" description:"datly rule repository location" `
	RoutesURL string
}

func (*Touch) Init

func (t *Touch) Init()

type Translate

type Translate struct {
	Rule
	Repository
}

func (*Translate) Init

func (d *Translate) Init(ctx context.Context) error

Jump to

Keyboard shortcuts

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