Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeCustomError(rpcErr error) (err error, ok bool)
- func DoGroup(f func(*Group)) *Statement
- func DoGroupMultiline(f func(*Group)) *Statement
- func FormatAccountDiscriminatorName(exportedAccountName string) string
- func FormatEventDiscriminatorName(exportedEventName string) string
- func FormatInstructionDiscriminatorName(exportedInstructionName string) string
- func FormatTupleItemName(index int) string
- func IDLTypeKind_ToTypeDeclCode(ts idltype.IdlType) *Statement
- func IsArray(v idltype.IdlType) bool
- func IsBool(v idltype.IdlType) bool
- func IsCOption(v idltype.IdlType) bool
- func IsDefined(v idltype.IdlType) bool
- func IsIDLTypeKind(v idltype.IdlType) bool
- func IsOption(v idltype.IdlType) bool
- func IsVec(v idltype.IdlType) bool
- func ListMultiline(f func(*Group)) *Statement
- func WriteFile(outDir string, assetFileName string, file *File) error
- type CustomError
- type Generator
- type GeneratorOptions
- type Output
- type OutputFile
Constants ¶
View Source
const ( PkgBinary = "github.com/gagliardetto/binary" PkgSolanaGo = "github.com/gagliardetto/solana-go" PkgSolanaGoText = "github.com/gagliardetto/solana-go/text" PkgAnchorGoErrors = "github.com/smartcontractkit/anchor-go/errors" // TODO: use or remove this: PkgTreeout = "github.com/gagliardetto/treeout" PkgFormat = "github.com/gagliardetto/solana-go/text/format" PkgGoFuzz = "github.com/gagliardetto/gofuzz" PkgTestifyRequire = "github.com/stretchr/testify/require" )
Variables ¶
View Source
var Debug = false // Set to true to enable debug logging.
View Source
var Errors = map[int]CustomError{}
Functions ¶
func DecodeCustomError ¶
func DoGroupMultiline ¶
func DoGroupMultiline(f func(*Group)) *Statement
func FormatTupleItemName ¶
func IsIDLTypeKind ¶
func ListMultiline ¶
func ListMultiline(f func(*Group)) *Statement
Types ¶
type CustomError ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(idl *idl.Idl, options *GeneratorOptions) *Generator
type GeneratorOptions ¶
type GeneratorOptions struct {
OutputDir string // Directory to write the generated code to.
Package string // Package name for the generated code.
ModPath string // Module path for the generated code. E.g. "github.com/gagliardetto/mysolana-program-go"
ProgramId *solana.PublicKey // Program ID to use in the generated code.
ProgramName string // Name of the program for the generated code.
SkipGoMod bool // If true, skip generating the go.mod file.
}
type Output ¶
type Output struct {
Files []*OutputFile // List of output files to be generated.
GoMod []byte // Go module file content.
}
type OutputFile ¶
type OutputFile struct {
Name string // Name of the output file.
File *File
}
Click to show internal directories.
Click to hide internal directories.