common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TetragonApiPackageName = "api/v1/tetragon"

TetragonApiPackageName is the import path for the code generated package

View Source
var TetragonCopyrightHeader = `// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Tetragon`

TetragonCopyrightHeader is the license header to prepend to all generated files

View Source
var TetragonPackageName = "github.com/cilium/tetragon"

TetragonPackageName is the import path for the Tetragon package

Functions

func BytesMatcherIdent

func BytesMatcherIdent(g *protogen.GeneratedFile, name string) string

func DurationMatcherIdent

func DurationMatcherIdent(g *protogen.GeneratedFile, name string) string

func EventFieldCheck

func EventFieldCheck(msg *protogen.Message, field string) bool

EventFieldCheck returns true if the event has the field

func FmtErrorf

func FmtErrorf(g *protogen.GeneratedFile, fmt_ string, args ...string) string

FmtErrorf is a convenience helper that generates a call to fmt.Errorf

func FmtSprintf

func FmtSprintf(g *protogen.GeneratedFile, fmt_ string, args ...string) string

FmtSprintf is a convenience helper that generates a call to fmt.Sprintf

func GeneratedIdent

func GeneratedIdent(g *protogen.GeneratedFile, importPath string, name string) string

GeneratedIdent is a convenience helper that returns a qualified go ident as a string for a given import package and name within the codegen package

func GetEnums

func GetEnums(files []*protogen.File) ([]*protogen.Enum, error)

GetEnums returns a list of all enums that are message fields

func GetEvents

func GetEvents(files []*protogen.File) ([]*protogen.Message, error)

GetEvents returns a list of all messages that are events

func GetFields

func GetFields(files []*protogen.File) ([]*protogen.Message, error)

GetFields returns a list of all messages that are fields

func GoIdent

func GoIdent(g *protogen.GeneratedFile, importPath string, name string) string

GoIdent is a convenience helper that returns a qualified go ident as a string for a given import package and name

func IsParentEvent

func IsParentEvent(msg *protogen.Message) bool

IsParentEvent returns true if the message is an Tetragon event that has a parent field

func IsProcessEvent

func IsProcessEvent(msg *protogen.Message) bool

IsProcessEvent returns true if the message is an Tetragon event that has a process field

func ListMatcherIdent

func ListMatcherIdent(g *protogen.GeneratedFile, name string) string

func Logger

func Logger(g *protogen.GeneratedFile) string

Logger is a convenience helper that generates a call to logger.GetLogger()

func NewCodegenFile

func NewCodegenFile(gen *protogen.Plugin, file *protogen.File, pkg string) *protogen.GeneratedFile

NewCodegenFile creates a new codegen pakage and file in the project

func NewFile

func NewFile(gen *protogen.Plugin, file *protogen.File, pkg string, pkgName string, fileName string) *protogen.GeneratedFile

NewFile creates a new pakage and file in the project

func PkgProcessIdent

func PkgProcessIdent(g *protogen.GeneratedFile, name string) string

func ProcessIdent

func ProcessIdent(g *protogen.GeneratedFile) string

func ProcessKprobeIdent added in v1.1.0

func ProcessKprobeIdent(g *protogen.GeneratedFile) string

func StringMatcherIdent

func StringMatcherIdent(g *protogen.GeneratedFile, name string) string

func StructTag

func StructTag(tag string) string

StructTag is a convenience helper that formats a struct tag

func TetragonApiIdent

func TetragonApiIdent(g *protogen.GeneratedFile, name string) string

TetragonApiIdent is a convenience helper that calls GoIdent with the path to the Tetragon API package.

func TetragonIdent

func TetragonIdent(g *protogen.GeneratedFile, importPath string, name string) string

TetragonIdent is a convenience helper that calls GoIdent with the path to the Tetragon package.

func TimestampMatcherIdent

func TimestampMatcherIdent(g *protogen.GeneratedFile, name string) string

Types

type GetEventsResponseOneofInfo

type GetEventsResponseOneofInfo struct {
	TypeName  string
	FieldName string
}

func GetEventsResponseOneofs

func GetEventsResponseOneofs(files []*protogen.File) ([]GetEventsResponseOneofInfo, error)

Jump to

Keyboard shortcuts

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