modules

package
v1.2.85 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultDir = "modules"
)

Variables

This section is empty.

Functions

func Unit

func Unit(file CodeFileWriter) (unit processes.Unit)

Types

type CodeFileUnit

type CodeFileUnit struct {
	// contains filtered or unexported fields
}

func (*CodeFileUnit) Handle

func (unit *CodeFileUnit) Handle(ctx context.Context) (result interface{}, err error)

type CodeFileWriter

type CodeFileWriter interface {
	Name() (name string)
	Write(ctx context.Context) (err error)
}

func NewDeploysFile

func NewDeploysFile(dir string, services Services) (file CodeFileWriter)

func NewServiceFile

func NewServiceFile(service *Service, annotations FnAnnotationCodeWriters) (file CodeFileWriter)

type Component

type Component struct {
	Indent string
}

type Components

type Components []*Component

func (Components) Len

func (components Components) Len() int

func (Components) Less

func (components Components) Less(i, j int) bool

func (Components) Swap

func (components Components) Swap(i, j int)

type DeploysFile

type DeploysFile struct {
	// contains filtered or unexported fields
}

func (*DeploysFile) Name

func (s *DeploysFile) Name() (name string)

func (*DeploysFile) Write

func (s *DeploysFile) Write(ctx context.Context) (err error)

type FnAnnotationCodeWriter

type FnAnnotationCodeWriter interface {
	Annotation() (annotation string)
	HandleBefore(ctx context.Context, params []string, hasFnParam bool, hasFnResult bool) (code gcg.Code, err error)
	HandleAfter(ctx context.Context, params []string, hasFnParam bool, hasFnResult bool) (code gcg.Code, err error)
	ProxyBefore(ctx context.Context, params []string, hasFnParam bool, hasFnResult bool) (code gcg.Code, err error)
	ProxyAfter(ctx context.Context, params []string, hasFnParam bool, hasFnResult bool) (code gcg.Code, err error)
}

type FnAnnotationCodeWriters

type FnAnnotationCodeWriters []FnAnnotationCodeWriter

func (FnAnnotationCodeWriters) Get

func (writers FnAnnotationCodeWriters) Get(annotation string) (w FnAnnotationCodeWriter, has bool)

type Function

type Function struct {
	Ident           string
	VarIdent        string
	ProxyIdent      string
	ProxyAsyncIdent string
	HandlerIdent    string
	Annotations     sources.Annotations
	Param           *FunctionField
	Result          *FunctionField
	// contains filtered or unexported fields
}

func (*Function) Annotation

func (f *Function) Annotation(name string) (params []string, has bool)

func (*Function) Authorization

func (f *Function) Authorization() (ok bool)

func (*Function) Barrier

func (f *Function) Barrier() (ok bool)

func (*Function) Cache

func (f *Function) Cache() (cmd string, ttl string, has bool)

func (*Function) CacheControl

func (f *Function) CacheControl() (maxAge int, public bool, mustRevalidate bool, proxyRevalidate bool, has bool, err error)

func (*Function) Deprecated

func (f *Function) Deprecated() (ok bool)

func (*Function) Description

func (f *Function) Description() (description string)

func (*Function) Errors

func (f *Function) Errors() (errs string)

func (*Function) FieldImports

func (f *Function) FieldImports() (v sources.Imports)

func (*Function) ForeachAnnotations

func (f *Function) ForeachAnnotations(fn func(name string, params []string))

func (*Function) Handle

func (f *Function) Handle(ctx context.Context) (result interface{}, err error)

func (*Function) HostServiceName

func (f *Function) HostServiceName() (name string)

func (*Function) Internal

func (f *Function) Internal() (ok bool)

func (*Function) Metric

func (f *Function) Metric() (ok bool)

func (*Function) Name

func (f *Function) Name() (name string)

func (*Function) Parse

func (f *Function) Parse(ctx context.Context) (err error)

func (*Function) Permission

func (f *Function) Permission() (ok bool)

func (*Function) Readonly

func (f *Function) Readonly() (ok bool)

func (*Function) Title

func (f *Function) Title() (title string)

func (*Function) Validation

func (f *Function) Validation() (title string, ok bool)

type FunctionError

type FunctionError struct {
	Name         string
	Descriptions map[string]string
}

type FunctionField

type FunctionField struct {
	Name string
	Type *sources.Type
	// contains filtered or unexported fields
}

func (*FunctionField) Paths

func (sf *FunctionField) Paths() (paths []string)

func (*FunctionField) String

func (sf *FunctionField) String() (v string)

type Functions

type Functions []*Function

func (Functions) Len

func (fns Functions) Len() int

func (Functions) Less

func (fns Functions) Less(i, j int) bool

func (Functions) Swap

func (fns Functions) Swap(i, j int)

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(dir string, annotations FnAnnotationCodeWriters, verbose bool) *Generator

func (*Generator) Generate

func (generator *Generator) Generate(ctx context.Context, mod *sources.Module) (err error)

type Service

type Service struct {
	Dir         string
	Path        string
	PathIdent   string
	Name        string
	Internal    bool
	Title       string
	Description string
	Imports     sources.Imports
	Functions   Functions
	Components  Components
	// contains filtered or unexported fields
}

type ServiceFile

type ServiceFile struct {
	// contains filtered or unexported fields
}

func (*ServiceFile) Name

func (s *ServiceFile) Name() (name string)

func (*ServiceFile) Write

func (s *ServiceFile) Write(ctx context.Context) (err error)

type Services

type Services []*Service

func Load

func Load(mod *sources.Module, dir string) (services Services, err error)

func (Services) Len

func (services Services) Len() int

func (Services) Less

func (services Services) Less(i, j int) bool

func (Services) Swap

func (services Services) Swap(i, j int)

Jump to

Keyboard shortcuts

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