types

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeType

type CompositeType interface {
	Kind() common.CompositeKind
	GetFields() []Field
	SetFields(fields []Field)
	GetFunctions() []Function
	SetFunctions(fns []Function)
	GetSubTypes() []CompositeType
	SetSubTypes(sb []CompositeType)
	SetName(n string)
	GetName() string
	GetSimpleName() string
	GetGoName() string // GetGoName returns name in go, if it's kind is struct, will add "Struct" prefix, if it's kind is resource, will add "Resource" prefix.
	SetOwnerType(own string)
}

type Contract

type Contract struct {
	PkgName                  string
	IgnoreContractGeneration bool
	// contains filtered or unexported fields
}

func (*Contract) FlattenSubTypes

func (c *Contract) FlattenSubTypes()

FlattenSubTypes move all subtypes to contracts subtypes

func (*Contract) GetFields

func (c *Contract) GetFields() []Field

func (*Contract) GetFunctions

func (c *Contract) GetFunctions() []Function

func (*Contract) GetGoName

func (c *Contract) GetGoName() string

func (*Contract) GetName

func (c *Contract) GetName() string

func (*Contract) GetSimpleName

func (c *Contract) GetSimpleName() string

func (*Contract) GetSubTypes

func (c *Contract) GetSubTypes() []CompositeType

func (*Contract) Kind added in v0.0.7

func (c *Contract) Kind() common.CompositeKind

func (*Contract) SetFields

func (c *Contract) SetFields(fields []Field)

func (*Contract) SetFunctions

func (c *Contract) SetFunctions(fns []Function)

func (*Contract) SetName

func (c *Contract) SetName(n string)

func (*Contract) SetOwnerType

func (c *Contract) SetOwnerType(owner string)

func (*Contract) SetSubTypes

func (c *Contract) SetSubTypes(sb []CompositeType)

type Event added in v0.0.7

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

func (*Event) GetFields added in v0.0.7

func (c *Event) GetFields() []Field

func (*Event) GetFunctions added in v0.0.7

func (c *Event) GetFunctions() []Function

func (*Event) GetGoName added in v0.0.7

func (e *Event) GetGoName() string

func (*Event) GetName added in v0.0.7

func (c *Event) GetName() string

func (*Event) GetSimpleName added in v0.0.7

func (c *Event) GetSimpleName() string

func (*Event) GetSubTypes added in v0.0.7

func (c *Event) GetSubTypes() []CompositeType

func (*Event) Kind added in v0.0.7

func (*Event) Kind() common.CompositeKind

func (*Event) SetFields added in v0.0.7

func (c *Event) SetFields(fields []Field)

func (*Event) SetFunctions added in v0.0.7

func (c *Event) SetFunctions(fns []Function)

func (*Event) SetName added in v0.0.7

func (c *Event) SetName(n string)

func (*Event) SetOwnerType added in v0.0.7

func (c *Event) SetOwnerType(owner string)

func (*Event) SetSubTypes added in v0.0.7

func (c *Event) SetSubTypes(sb []CompositeType)

type Field

type Field struct {
	Name   string
	GoName string
	Type   string
	GoType string
}

type FlowJson added in v0.0.8

type FlowJson struct {
	Contracts map[string]any `json:"contracts"`
}

func (*FlowJson) ResolvePath added in v0.0.8

func (f *FlowJson) ResolvePath(flowJsonPath, pkgName, outputDir string) ([]string, []string)

ResolvePath resolve contracts file path, and concat contract output path

type Function

type Function struct {
	OwnerTypeName    string
	Name             string
	GoName           string // first letter uppercase
	Params           []FunctionParam
	ReturnType       string // for return type of script
	ReturnSimpleType string // for convert to go type
	ReturnGoType     string
	// contains filtered or unexported fields
}

func (*Function) AddUsedCommaAuth

func (fn *Function) AddUsedCommaAuth() int

AddUsedCommaAuth manually add index

func (*Function) AddUsedCommaCommon

func (fn *Function) AddUsedCommaCommon() int

AddUsedCommaCommon manually add index

func (*Function) AuthorizerCount

func (fn *Function) AuthorizerCount() int

func (*Function) CommaCountAll

func (fn *Function) CommaCountAll() int

CommaCountAll returns length of all params - 1, used to check necessary for comma adding.

func (*Function) CommaCountAuth

func (fn *Function) CommaCountAuth() int

CommaCountAuth returns length of all auth params - 1, used to check necessary for comma adding.

func (*Function) CommaCountCommon

func (fn *Function) CommaCountCommon() int

CommaCountCommon returns length of all common params - 1, used to check necessary for comma adding.

func (*Function) GenCadenceScript

func (fn *Function) GenCadenceScript() (string, error)

func (*Function) IsReturnMap

func (fn *Function) IsReturnMap() bool

type FunctionParam

type FunctionParam struct {
	Label  string
	Name   string
	Type   string
	GoType string
}

type Resource

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

func (*Resource) GetFields

func (c *Resource) GetFields() []Field

func (*Resource) GetFunctions

func (c *Resource) GetFunctions() []Function

func (*Resource) GetGoName

func (r *Resource) GetGoName() string

func (*Resource) GetName

func (c *Resource) GetName() string

func (*Resource) GetSimpleName

func (c *Resource) GetSimpleName() string

func (*Resource) GetSubTypes

func (c *Resource) GetSubTypes() []CompositeType

func (*Resource) Kind added in v0.0.7

func (r *Resource) Kind() common.CompositeKind

func (*Resource) SetFields

func (c *Resource) SetFields(fields []Field)

func (*Resource) SetFunctions

func (c *Resource) SetFunctions(fns []Function)

func (*Resource) SetName

func (c *Resource) SetName(n string)

func (*Resource) SetOwnerType

func (c *Resource) SetOwnerType(owner string)

func (*Resource) SetSubTypes

func (c *Resource) SetSubTypes(sb []CompositeType)

type Struct

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

func (*Struct) GetFields

func (c *Struct) GetFields() []Field

func (*Struct) GetFunctions

func (c *Struct) GetFunctions() []Function

func (*Struct) GetGoName

func (s *Struct) GetGoName() string

func (*Struct) GetName

func (c *Struct) GetName() string

func (*Struct) GetSimpleName

func (c *Struct) GetSimpleName() string

func (*Struct) GetSubTypes

func (c *Struct) GetSubTypes() []CompositeType

func (*Struct) Kind added in v0.0.7

func (s *Struct) Kind() common.CompositeKind

func (*Struct) SetFields

func (c *Struct) SetFields(fields []Field)

func (*Struct) SetFunctions

func (c *Struct) SetFunctions(fns []Function)

func (*Struct) SetName

func (c *Struct) SetName(n string)

func (*Struct) SetOwnerType

func (c *Struct) SetOwnerType(owner string)

func (*Struct) SetSubTypes

func (c *Struct) SetSubTypes(sb []CompositeType)

Jump to

Keyboard shortcuts

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