pkg

package
v0.0.0-...-d769c58 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindCCParam

type BindCCParam struct {
	FQDN         string
	PkgPath      string
	ReplaceNames []string
	Headers      []string
	Sources      []SourceParam
	Deps         []string
}

type BindGoParam

type BindGoParam struct {
	Compiler        string
	DebugMode       bool
	Pkg             string
	FQDN            string
	ImportUnsafePkg bool
	IncludePaths    []string
	CXXFlags        []string
	LDFlags         []string
	BridgeHeaders   []string
	ImportGoLibs    []string
	Funcs           []Func
	ExportFuncs     []ExportFunc
}

type Bridge

type Bridge struct {
	Packages []Package
}

func LoadBridge

func LoadBridge(bridgeYAML []byte) (*Bridge, error)

type BridgeExternParam

type BridgeExternParam struct {
	Funcs []Func
}

type BuildFileParser

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

func NewBuildFileParser

func NewBuildFileParser(cfg *Config) *BuildFileParser

func (*BuildFileParser) Parse

func (p *BuildFileParser) Parse(path string) (*ParsedFile, error)

type CCLibConfig

type CCLibConfig struct {
	Excludes []string `yaml:"excludes"`
}

type Config

type Config struct {
	Dependencies                    []ThirdPartyDependency `yaml:"dependencies"`
	GlobalSymbols                   []string               `yaml:"global_symbols"`
	TopLevelNamespaces              []string               `yaml:"top_level_namespaces"`
	ConflictSymbols                 []ConflictSymbol       `yaml:"conflict_symbols"`
	AddSources                      []SourceConfig         `yaml:"add_sources"`
	ExcludeZetaSQLDirs              []string               `yaml:"exclude_zetasql_dirs"`
	ProtobufInternalExportNameFiles []string               `yaml:"protobuf_internal_export_name_files"`
	CCLib                           CCLibConfig            `yaml:"cclib"`
	Protoc                          []ProtocConfig         `yaml:"protoc"`
}

func LoadConfig

func LoadConfig(configYAML []byte) (*Config, error)

type ConflictSymbol

type ConflictSymbol struct {
	File   string `yaml:"file"`
	Symbol string `yaml:"symbol"`
}

type Dependency

type Dependency struct {
	Value   string
	Lib     string
	BasePkg string
	Pkg     string
}

type DependencyConfig

type DependencyConfig struct {
	Base string `yaml:"base"`
	Pkg  string `yaml:"pkg"`
}

type ExportFunc

type ExportFunc struct {
	Func
	LibName string
}

type Func

type Func struct {
	BasePkg string
	Name    string
	Args    []Type
}

type Generator

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

func NewGenerator

func NewGenerator(cfg *Config, bridge *Bridge, importSymbol *ImportSymbol, templates embed.FS) *Generator

func (*Generator) Generate

func (g *Generator) Generate() error

type ImportSymbol

type ImportSymbol = Bridge

func LoadImport

func LoadImport(importYAML []byte) (*ImportSymbol, error)

type Lib

type Lib struct {
	BasePkg     string
	Name        string
	Headers     []string
	Sources     []string
	Deps        []Dependency
	LinkerFlags []LinkerFlag
}

func (*Lib) HeaderPaths

func (lib *Lib) HeaderPaths() []string

func (*Lib) NeedsBuildConstraint

func (lib *Lib) NeedsBuildConstraint() bool

func (*Lib) SourcePaths

func (lib *Lib) SourcePaths() []string

type LinkerFlag

type LinkerFlag struct {
	OSType OSType
	Flag   string
}

type Method

type Method struct {
	Name string   `yaml:"name"`
	Args []string `yaml:"args,omitempty"`
	Ret  []string `yaml:"ret,omitempty"`
}

type OSType

type OSType int
const (
	Darwin  OSType = 0
	Linux   OSType = 1
	Windows OSType = 2
)

type Package

type Package struct {
	Name    string   `yaml:"package"`
	Methods []Method `yaml:"methods"`
}

type ParsedFile

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

type ProtocConfig

type ProtocConfig struct {
	Name string   `yaml:"name"`
	Deps []string `yaml:"deps"`
}

type SourceConfig

type SourceConfig struct {
	File   string `yaml:"file"`
	Source string `yaml:"source"`
}

type SourceParam

type SourceParam struct {
	Value             string
	BeforeIncludeHook string
	AfterIncludeHook  string
}

type ThirdPartyDependency

type ThirdPartyDependency struct {
	Name string             `yaml:"name"`
	FQDN string             `yaml:"fqdn"`
	Deps []DependencyConfig `yaml:"deps"`
}

type Type

type Type struct {
	IsCustomType bool
	IsRetType    bool
	NeedsCast    bool
	GO           string
	CGO          string
	C            string
}

func (*Type) GoToC

func (t *Type) GoToC(index int) string

Jump to

Keyboard shortcuts

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