builtin

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoColor    = "\033[1;34m%s\033[0m"
	NoticeColor  = "\033[1;36m%s\033[0m"
	WarningColor = "\033[1;33m%s\033[0m"
	ErrorColor   = "\033[1;31m%s\033[0m"
	DebugColor   = "\033[0;36m%s\033[0m"
)
View Source
const DefaultMetafileName = "sobjects.yml"

Variables

View Source
var BlobType = &ast.ClassType{Name: "Blob"}
View Source
var BlobTypeParameter = &ast.Parameter{
	Type: BlobType,
	Name: "_",
}
View Source
var BooleanType = &ast.ClassType{
	Name:            "Boolean",
	InstanceMethods: ast.NewMethodMap(),
	StaticMethods:   ast.NewMethodMap(),
	ToString: func(o *ast.Object) string {
		return fmt.Sprintf("%t", o.Value().(bool))
	},
}
View Source
var Break = &ast.Object{ClassType: BreakType}
View Source
var BreakType = &ast.ClassType{Name: "Break"}
View Source
var Continue = &ast.Object{ClassType: ContinueType}
View Source
var ContinueType = &ast.ClassType{Name: "Continue"}
View Source
var DatabaseDriver = NewDatabaseDriver()
View Source
var DateType = ast.CreateClass(
	"Date",
	[]*ast.Method{},
	ast.NewMethodMap(),
	ast.NewMethodMap(),
)
View Source
var DatetimeType = ast.CreateClass(
	"Datetime",
	[]*ast.Method{},
	ast.NewMethodMap(),
	ast.NewMethodMap(),
)
View Source
var DoubleType = &ast.ClassType{
	Name:            "Double",
	InstanceMethods: ast.NewMethodMap(),
	StaticMethods:   ast.NewMethodMap(),
	ToString: func(o *ast.Object) string {
		return fmt.Sprintf("%f", o.Value().(float64))
	},
}
View Source
var ExceptionType = &ast.ClassType{}
View Source
var IntegerType = &ast.ClassType{
	Name:            "Integer",
	InstanceMethods: ast.NewMethodMap(),
	StaticMethods:   ast.NewMethodMap(),
	ToString: func(o *ast.Object) string {
		return fmt.Sprintf("%d", o.Value().(int))
	},
}
View Source
var IntegerTypeParameter = &ast.Parameter{
	Type: IntegerType,
	Name: "_",
}
View Source
var ListType = &ast.ClassType{Name: "List"}
View Source
var ListTypeParameter = &ast.Parameter{
	Type: ListType,
	Name: "_",
}
View Source
var LongType = &ast.ClassType{
	Name:            "Long",
	InstanceMethods: ast.NewMethodMap(),
	StaticMethods:   ast.NewMethodMap(),
	ToString: func(o *ast.Object) string {
		return fmt.Sprintf("%d", o.IntegerValue())
	},
}
View Source
var MapType = createMapType()
View Source
var Null = &ast.Object{
	ClassType:      NullType,
	InstanceFields: ast.NewObjectMap(),
	Extra:          map[string]interface{}{},
}
View Source
var NullType = &ast.ClassType{
	Name:     "null",
	ToString: func(o *ast.Object) string { return "null" },
}
View Source
var ObjectType = ast.CreateClass(
	"Object",
	[]*ast.Method{},
	nil,
	nil,
)
View Source
var PrimitiveClasses []*ast.ClassType
View Source
var RaiseType = &ast.ClassType{Name: "Raise"}
View Source
var ReturnType = &ast.ClassType{Name: "Return"}
View Source
var SObjectType = &ast.ClassType{Name: "SObject"}
View Source
var SObjectTypeParameter = &ast.Parameter{
	Type: SObjectType,
	Name: "_",
}
View Source
var StringType = &ast.ClassType{Name: "String"}
View Source
var T1type = &ast.ClassType{Name: "T:1"}
View Source
var T2type = &ast.ClassType{Name: "T:2"}

Functions

func CreateDatabase added in v0.1.2

func CreateDatabase(src string) error

func CreateListObject added in v0.1.1

func CreateListObject(classType *ast.ClassType, records []*ast.Object) *ast.Object

func CreateListType added in v0.1.2

func CreateListType(classType *ast.ClassType) *ast.ClassType

func CreateListTypeParameter added in v0.1.1

func CreateListTypeParameter(classType *ast.ClassType) *ast.Parameter

func CreateListTypeRef added in v0.1.1

func CreateListTypeRef(typeRef *ast.TypeRef) *ast.TypeRef

func CreateMapType added in v0.1.2

func CreateMapType(keyClass, valueClass *ast.ClassType) *ast.ClassType

func CreateMetadataFile added in v0.1.1

func CreateMetadataFile(username, password, endpoint, filename string, standardObjects []string) error

func CreateRaise added in v0.1.2

func CreateRaise(value *ast.Object) *ast.Object

func CreateReturn added in v0.1.2

func CreateReturn(value *ast.Object) *ast.Object

func Debug added in v0.1.2

func Debug(obj interface{})

func Equals added in v0.1.2

func Equals(t, other *ast.ClassType) bool

func LoadSObjectClass added in v0.1.2

func LoadSObjectClass(src string)

func NewBlob added in v0.1.2

func NewBlob(value []byte) *ast.Object

func NewBoolean added in v0.1.1

func NewBoolean(value bool) *ast.Object

func NewClassMapWithPrimivie

func NewClassMapWithPrimivie(classTypes []*ast.ClassType) *ast.ClassMap

func NewDatabaseDriver added in v0.1.1

func NewDatabaseDriver() *databaseDriver

func NewDouble added in v0.1.1

func NewDouble(value float64) *ast.Object

func NewInteger added in v0.1.1

func NewInteger(value int) *ast.Object

func NewLong added in v0.1.3

func NewLong(value int) *ast.Object

func NewSoapClient added in v0.1.1

func NewSoapClient(username, password, endpoint string) *soapforce.Client

func NewString added in v0.1.1

func NewString(value string) *ast.Object

func PrimitiveClassMap

func PrimitiveClassMap() *ast.ClassMap

func SearchMethod added in v0.1.2

func SearchMethod(receiverClass *ast.ClassType, methods []*ast.Method, parameters []*ast.ClassType) *ast.Method

func Seed added in v0.1.1

func Seed(username, password, endpoint, src string) error

func String

func String(o *ast.Object) string

Types

type EqualChecker added in v0.1.2

type EqualChecker interface {
	Equals(*ast.Object, *ast.Object) bool
}

type Loader added in v0.1.1

type Loader interface {
	Load() (map[string]Sobject, error)
}

type MetaFileLoader added in v0.1.1

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

func NewMetaFileLoader added in v0.1.3

func NewMetaFileLoader(src string) *MetaFileLoader

func (*MetaFileLoader) Load added in v0.1.1

func (m *MetaFileLoader) Load() (map[string]Sobject, error)

type NameSpaceStore

type NameSpaceStore struct {
	Data map[string]*ast.ClassMap
}

*

  • NameSpaces

func GetNameSpaceStore added in v0.1.1

func GetNameSpaceStore() *NameSpaceStore

func NewNameSpaceStore

func NewNameSpaceStore() *NameSpaceStore

func (*NameSpaceStore) Add

func (m *NameSpaceStore) Add(k string, n *ast.ClassType)

func (*NameSpaceStore) Get

func (m *NameSpaceStore) Get(k string) (*ast.ClassMap, bool)

func (*NameSpaceStore) Set

func (m *NameSpaceStore) Set(k string, n *ast.ClassMap)

type NullPointerException added in v0.1.3

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

func NewNullPointerException added in v0.1.3

func NewNullPointerException(name string) *NullPointerException

func (*NullPointerException) Error added in v0.1.3

func (e *NullPointerException) Error() string

func (*NullPointerException) GetName added in v0.1.3

func (e *NullPointerException) GetName() string

type Relation added in v0.1.1

type Relation struct {
	RelationshipName string
	FieldName        string
	ReferenceTo      string
}

type Sobject added in v0.1.1

type Sobject struct {
	Name          string
	Custom        bool
	CustomSetting bool
	Label         string
	Fields        []SobjectField
}

type SobjectField added in v0.1.1

type SobjectField struct {
	Name             string
	Type             string
	Label            string
	RelationshipName string
	Custom           bool
	ReferenceTo      []string
}

type SqlBuilder added in v0.1.1

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

func (*SqlBuilder) Build added in v0.1.1

func (b *SqlBuilder) Build(n *ast.Soql) (string, [][]string, map[string]Relation)

type TestError added in v0.1.2

type TestError struct {
	Node    ast.Node
	Message string
}

type ToStringer

type ToStringer struct {
	Indent int
}

func (*ToStringer) AddIndent

func (v *ToStringer) AddIndent(f func())

func (*ToStringer) String

func (v *ToStringer) String(o *ast.Object) string

type TypeRefResolver added in v0.1.1

type TypeRefResolver struct {
	NameSpaces   *NameSpaceStore
	ClassTypes   *ast.ClassMap
	CurrentClass *ast.ClassType
}

func (*TypeRefResolver) ConvertType added in v0.1.1

func (r *TypeRefResolver) ConvertType(n *ast.TypeRef) (*ast.ClassType, error)

func (*TypeRefResolver) ResolveType added in v0.1.1

func (r *TypeRefResolver) ResolveType(names []string) (*ast.ClassType, error)

Jump to

Keyboard shortcuts

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