compiler

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Languages

func Languages() []string

Languages returns a sorted list of the language of the registered compiler constructors

func Register

func Register(language string, cnstr Constructor)

Register makes a compiler constructor available for the specified language. panic if Register is called twice with the same language or if compiler is nil

Types

type Compiler

type Compiler interface {
	// Compile compiles a set of policies into a string
	Compile(pkgname string, pols *ast.Policies, swaggerTypes []types.Type) (string, error)
}

compiler defines the interface for the language specific compiler backends

func New

func New(language string) (Compiler, error)

New creates a new compiler

type Constructor

type Constructor func() (Compiler, error)

Constructor defines the type for a compiler constructor

type IPolicyCompiler

type IPolicyCompiler interface {
	Compile(packageName string, policyString string) (string, error)
}

type PolicyCompiler

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

func NewPolicyCompiler

func NewPolicyCompiler(backend string, swaggerTypes ...string) (*PolicyCompiler, error)

func (*PolicyCompiler) Compile

func (rc *PolicyCompiler) Compile(packageName string, policyString string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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