types

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeString = "string"

	TagRequired = "string"
)

consts

Variables

This section is empty.

Functions

func Generate

func Generate(name string, schema data.JSONSchema, result *ContractTypeResult) (string, error)

Generate -

func GenerateBigMap

func GenerateBigMap(bigMap data.BigMapJSONSchema, result *ContractTypeResult) error

GenerateBigMap -

Types

type Address

type Address struct{}

Address -

func (Address) AsCode

func (Address) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Address) AsField

func (Address) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Address) AsType

func (Address) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type BigMap

type BigMap struct{}

BigMap -

func (BigMap) AsCode

func (BigMap) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (BigMap) AsField

func (BigMap) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (BigMap) AsType

func (BigMap) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type BigMapData

type BigMapData struct {
	Type      string
	KeyType   string
	ValueType string
}

BigMapData -

type Bool

type Bool struct{}

Bool -

func (Bool) AsCode

func (Bool) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Bool) AsField

func (Bool) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Bool) AsType

func (Bool) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Bytes

type Bytes struct{}

Bytes -

func (Bytes) AsCode

func (Bytes) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Bytes) AsField

func (Bytes) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Bytes) AsType

func (Bytes) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Code

type Code struct {
	Statement jen.Code
	Name      string
}

Code -

type Contract

type Contract struct{}

Contract -

func (Contract) AsCode

func (Contract) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Contract) AsField

func (Contract) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Contract) AsType

func (Contract) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type ContractTypeResult

type ContractTypeResult struct {
	File        *jen.File
	Entrypoints map[string]EntrypointData
	BigMaps     map[string]BigMapData
	PackageName string
	// contains filtered or unexported fields
}

ContractTypeResult -

func GenerateContractTypes

func GenerateContractTypes(schema data.ContractJSONSchema, packageName string) (ContractTypeResult, error)

GenerateContractTypes -

func (*ContractTypeResult) GetName

func (result *ContractTypeResult) GetName(typ, name string) string

GetName -

type EntrypointData

type EntrypointData struct {
	Type string
	Var  string
}

EntrypointData -

type Int

type Int struct{}

Int -

func (Int) AsCode

func (Int) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Int) AsField

func (Int) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Int) AsType

func (Int) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type KeyHash

type KeyHash struct{}

KeyHash -

func (KeyHash) AsCode

func (KeyHash) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (KeyHash) AsField

func (KeyHash) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (KeyHash) AsType

func (KeyHash) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Lambda

type Lambda struct{}

Lambda -

func (Lambda) AsCode

func (Lambda) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Lambda) AsField

func (Lambda) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Lambda) AsType

func (Lambda) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type List

type List struct{}

List -

func (List) AsCode

func (l List) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (List) AsField

func (List) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (List) AsType

func (l List) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Map

type Map struct{}

Map -

func (Map) AsCode

func (m Map) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Map) AsField

func (m Map) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Map) AsType

func (m Map) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Object

type Object struct{}

Object -

func (Object) AsCode

func (obj Object) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Object) AsField

func (Object) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Object) AsType

func (obj Object) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Option

type Option struct{}

Option -

func (Option) AsCode

func (opt Option) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Option) AsField

func (Option) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Option) AsType

func (opt Option) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Or

type Or struct{}

Object -

func (Or) AsCode

func (obj Or) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Or) AsField

func (Or) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Or) AsType

func (obj Or) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type SaplingState

type SaplingState struct{}

SaplingState -

func (SaplingState) AsCode

func (SaplingState) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (SaplingState) AsField

func (SaplingState) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (SaplingState) AsType

func (SaplingState) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type SaplingTransaction

type SaplingTransaction struct{}

SaplingTransaction -

func (SaplingTransaction) AsCode

func (SaplingTransaction) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (SaplingTransaction) AsField

func (SaplingTransaction) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (SaplingTransaction) AsType

func (SaplingTransaction) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Set

type Set struct{}

Set -

func (Set) AsCode

func (s Set) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Set) AsField

func (s Set) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Set) AsType

func (s Set) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type String

type String struct{}

String -

func (String) AsCode

func (String) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (String) AsField

func (String) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (String) AsType

func (String) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Ticket

type Ticket struct{}

Ticket -

func (Ticket) AsCode

func (Ticket) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Ticket) AsField

func (Ticket) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Ticket) AsType

func (Ticket) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Timestamp

type Timestamp struct{}

Timestamp -

func (Timestamp) AsCode

func (Timestamp) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Timestamp) AsField

func (Timestamp) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Timestamp) AsType

func (Timestamp) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

type Type

type Type interface {
	AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)
	AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)
	AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)
}

Type -

type Unit

type Unit struct{}

Unit -

func (Unit) AsCode

func (Unit) AsCode(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsCode -

func (Unit) AsField

func (Unit) AsField(name, path string, schema data.JSONSchema, isRequired bool, result *ContractTypeResult) (jen.Code, error)

AsField -

func (Unit) AsType

func (Unit) AsType(name, path string, schema data.JSONSchema, result *ContractTypeResult) (Code, error)

AsType -

Jump to

Keyboard shortcuts

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