Versions in this module Expand all Collapse all v0 v0.15.1 Aug 16, 2024 v0.15.0 Jul 8, 2024 v0.14.0 Apr 24, 2024 Changes in this version + var LanaiConsulSD = &LanaiModule v0.13.0 Feb 27, 2024 Changes in this version + const GroupOrderAPI + const GroupOrderOPAPolicy + const GroupOrderProject + const GroupOrderSecurity + const KDataLanaiModules + const KDataOPAPolicy + const KDataOpenAPI + const KDataProject + const KDataProjectName + const KDataRepository + const KDataSecurity + var DefaultOption = Option + var LanaiActuator = &LanaiModule + var LanaiAppConfig = &LanaiModule + var LanaiCockroach = &LanaiModule + var LanaiConsul = &LanaiModule + var LanaiDSync = &LanaiModule + var LanaiData = &LanaiModule + var LanaiDiscovery = &LanaiModule + var LanaiHttpClient = &LanaiModule + var LanaiKafka = &LanaiModule + var LanaiModuleDependencies = map[*LanaiModule][]*LanaiModule + var LanaiOPA = &LanaiModule + var LanaiRedis = &LanaiModule + var LanaiResServer = &LanaiModule + var LanaiSecurity = &LanaiModule + var LanaiSecurityScope = &LanaiModule + var LanaiSwagger = &LanaiModule + var LanaiTracing = &LanaiModule + var LanaiVault = &LanaiModule + var LanaiWeb = &LanaiModule + var SupportedLanaiModules = LanaiModules + func FormatFile(path string, typeHint FileType) error + func GenerateFileFromTemplate(gc GenerationContext, template *template.Template) error + func GenerateFiles(ctx context.Context, opts ...Options) error + func LoadTemplates(fsys fs.FS, opts ...TemplateOptions) (tmpl *template.Template, err error) + func ResolveEnabledLanaiModules(modules ...*LanaiModule) (ret utils.StringSet) + func WithComponents(comps Components) func(o *Option) + func WithProject(project Project) func(o *Option) + func WithRegenRules(rules RegenRules, defaultMode RegenMode) func(o *Option) + func WithTemplateFS(templateFS fs.FS) func(o *Option) + type APIGroup struct + func (g APIGroup) CustomizeData(data GenerationData) error + func (g APIGroup) CustomizeTemplate() (TemplateOptions, error) + func (g APIGroup) Generators(opts ...GeneratorOptions) ([]Generator, error) + func (g APIGroup) Name() string + func (g APIGroup) Order() int + type Access struct + Preset AccessPreset + type AccessPreset string + const AccessPresetFreestyle + const AccessPresetOPA + type ApiGenerator struct + func (g *ApiGenerator) Generate(ctx context.Context, tmplDesc TemplateDescriptor) error + func (g *ApiGenerator) Order() int + type ApiOption struct + Matcher TemplateMatcher + Order int + Prefix string + type ApiVerOption struct + type ApiVersionGenerator struct + func (g *ApiVersionGenerator) Generate(ctx context.Context, tmplDesc TemplateDescriptor) error + type Authentication struct + Method AuthenticationMethod + type AuthenticationMethod string + const AuthNone + const AuthOAuth2 + type CleanupGenerator struct + func (g *CleanupGenerator) Generate(_ context.Context, tmplDesc TemplateDescriptor) error + func (g *CleanupGenerator) Order() int + type CleanupOption struct + Order int + type Components struct + Contract Contract + Security Security + type Contract struct + Naming ContractNaming + Path string + type ContractNaming struct + RegExps map[string]string + type DirOption struct + Matcher TemplateMatcher + OutputResolver TemplateOutputResolver + type DirectoryGenerator struct + func (d *DirectoryGenerator) Generate(ctx context.Context, tmplDesc TemplateDescriptor) error + type FileGenerator struct + func (g *FileGenerator) Generate(ctx context.Context, tmplDesc TemplateDescriptor) error + func (g *FileGenerator) Order() int + type FileOption struct + Matcher TemplateMatcher + Order int + OutputResolver TemplateOutputResolver + Prefix string + type FileType string + const FileTypeGo + const FileTypeRego + const FileTypeUnknown + const FileTypeYaml + type GenerationContext struct + func NewGenerationContext(templatePath string, filename string, regenMode RegenMode, model interface{}) *GenerationContext + type GenerationData map[string]interface + func (d GenerationData) ProjectMetadata() *ProjectMetadata + func NewGenerationData(p *Project) GenerationData + type Generator interface + Generate func(ctx context.Context, tmplDesc TemplateDescriptor) error + type GeneratorOption struct + Data GenerationData + Template *template.Template + type GeneratorOptions func(opt *GeneratorOption) + type Generators struct + func NewGenerators(opts ...Options) Generators + func (g *Generators) Generate(ctx context.Context) error + type GoSourceFormatter struct + func (f GoSourceFormatter) Format(in []byte) ([]byte, error) + type Group interface + CustomizeData func(data GenerationData) error + CustomizeTemplate func() (TemplateOptions, error) + Generators func(opts ...GeneratorOptions) ([]Generator, error) + Name func() string + type LanaiModule struct + Alias string + InitPackage string + Name string + func (m LanaiModule) ImportAlias() string + func (m LanaiModule) ImportPath(root string) string + func (m LanaiModule) Ref() string + type LanaiModuleGroup []*LanaiModule + func (g LanaiModuleGroup) FilterByName(filter utils.StringSet) []*LanaiModule + type LanaiModules struct + Basic LanaiModuleGroup + Data LanaiModuleGroup + Integration LanaiModuleGroup + Others LanaiModuleGroup + Security LanaiModuleGroup + Web LanaiModuleGroup + func (m LanaiModules) Modules() (ret LanaiModuleGroup) + type OPAPolicyData struct + APIPackage string + type OPAPolicyGroup struct + func (g OPAPolicyGroup) CustomizeData(data GenerationData) error + func (g OPAPolicyGroup) CustomizeTemplate() (TemplateOptions, error) + func (g OPAPolicyGroup) Generators(opts ...GeneratorOptions) ([]Generator, error) + func (g OPAPolicyGroup) Name() string + func (g OPAPolicyGroup) Order() int + type Option struct + Components Components + DefaultRegenMode RegenMode + Project Project + RegenRules RegenRules + TemplateFS fs.FS + type Options func(opt *Option) + type Project struct + ContextPath string + Description string + Module string + Name string + Port int + type ProjectGroup struct + func (g ProjectGroup) CustomizeData(data GenerationData) error + func (g ProjectGroup) CustomizeTemplate() (TemplateOptions, error) + func (g ProjectGroup) Generators(opts ...GeneratorOptions) ([]Generator, error) + func (g ProjectGroup) Name() string + func (g ProjectGroup) Order() int + type ProjectMetadata struct + EnabledModules utils.StringSet + type RegenMode string + const RegenModeIgnore + const RegenModeOverwrite + const RegenModeReference + type RegenRule struct + Mode RegenMode + Pattern string + type RegenRules []RegenRule + type RegoFormatter struct + func (f RegoFormatter) Format(in []byte) ([]byte, error) + type Security struct + Access Access + Authentication Authentication + type SecurityGroup struct + func (g SecurityGroup) CustomizeData(data GenerationData) error + func (g SecurityGroup) CustomizeTemplate() (TemplateOptions, error) + func (g SecurityGroup) Generators(opts ...GeneratorOptions) ([]Generator, error) + func (g SecurityGroup) Name() string + func (g SecurityGroup) Order() int + type TemplateDescriptor struct + FileInfo fs.FileInfo + Path string + type TemplateFuncProvider func(funcMap template.FuncMap) (template.FuncMap, error) + type TemplateMatcher cmdutils.ChainableMatcher[TemplateDescriptor] + type TemplateOption struct + FuncProviders []TemplateFuncProvider + Pattern string + PostHooks []TemplatePostHook + PreloadHooks []TemplatePreHook + type TemplateOptions func(opt *TemplateOption) + type TemplateOutputDescriptor struct + Path string + type TemplateOutputResolver interface + Resolve func(ctx context.Context, tmplDesc TemplateDescriptor, data GenerationData) (TemplateOutputDescriptor, error) + type TemplateOutputResolverFunc func(ctx context.Context, tmplDesc TemplateDescriptor, data GenerationData) (TemplateOutputDescriptor, error) + func (fn TemplateOutputResolverFunc) Resolve(ctx context.Context, tmplDesc TemplateDescriptor, data GenerationData) (TemplateOutputDescriptor, error) + type TemplatePostHook func(tmpl *template.Template) (*template.Template, error) + type TemplatePreHook func(tmpl *template.Template, tmplPaths []string) (*template.Template, []string, error) + type TextFormatter interface + Format func(in []byte) ([]byte, error) + type YamlFormatter struct + func (f YamlFormatter) Format(in []byte) ([]byte, error)