common

package
v0.0.0-...-c68ee8d Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package common holds common related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventTypeMetadata

type EventTypeMetadata struct {
	Doc    string
	Fields []string
}

EventTypeMetadata is used to iterate over the model from the event types

func NewEventTypeMetada

func NewEventTypeMetada(fields ...string) *EventTypeMetadata

NewEventTypeMetada returns a new EventTypeMetada

type Module

type Module struct {
	Name            string
	SourcePkgPrefix string
	SourcePkg       string
	TargetPkg       string
	BuildTags       []string
	Fields          map[string]*StructField // Fields only contains fields that are exposed in SECL
	//GettersOnlyFields map[string]*StructField // GettersOnlyFields only contains fields that have generated getters but are not exposed in SECL
	AllFields  map[string]*StructField
	Iterators  map[string]*StructField
	EventTypes map[string]*EventTypeMetadata
	Mock       bool
}

Module represents everything needed to generate the accessors for a specific module (fields, build tags, ...)

type Platform

type Platform string

Platform defines which platform a structure is associated with

const (
	Unspecified Platform = "unspecified" // Unspecified defines unspecified platforms
	Linux       Platform = "linux"       // Linux defines linux platforms
	Windows     Platform = "windows"     // Windows defines windows platforms
)

type StructField

type StructField struct {
	Name             string
	Prefix           string
	Struct           string
	BasicType        string
	ReturnType       string
	IsArray          bool
	IsLength         bool
	Event            string
	Handler          string
	Helper           bool // specify the handler as just a helper and not a real resolver. It means that this handler won't be called by the ResolveFields function
	SkipADResolution bool
	OrigType         string
	IsOrigTypePtr    bool
	Iterator         *StructField
	Weight           int64
	CommentText      string
	OpOverrides      string
	Check            string
	SetHandler       string
	Alias            string
	AliasPrefix      string
	GettersOnly      bool
	GenGetters       bool
	Ref              string
	RestrictedTo     []string
	IsIterator       bool
	ReadOnly         bool
}

StructField represents a structure field for which an accessor will be generated

func (*StructField) GetArrayPrefix

func (sf *StructField) GetArrayPrefix() string

GetArrayPrefix returns the array prefix of this field

func (*StructField) GetCacheName

func (sf *StructField) GetCacheName() string

GetCacheName returns the cache name

func (*StructField) GetDefaultReturnValue

func (sf *StructField) GetDefaultReturnValue() string

GetDefaultReturnValue returns default value for the given return type

func (*StructField) GetDefaultScalarReturnValue

func (sf *StructField) GetDefaultScalarReturnValue() string

GetDefaultScalarReturnValue returns default scalar value for the given return type

func (*StructField) GetEvaluatorType

func (sf *StructField) GetEvaluatorType() string

GetEvaluatorType returns the evaluator type name

Jump to

Keyboard shortcuts

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