parsestruct

package
v0.0.0-...-4c82413 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package parsestruct parses a file and returns name and information of every struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	Name       string
	Offset     int64
	Size       int64
	Type       string
	StructInfo *StructInfo // if not struct, nil
}

type GoPackInfo

type GoPackInfo struct {
	PackageName string
	Imports     []*types.Package
	StructInfo  []*StructInfo
}

func GetPackInfo

func GetPackInfo(filename string) (GoPackInfo, error)

GetPackInfo returns required information including package name and struct names and informations from a file, if any struct contains go specific type(slice, map, chan, interface, function signature) which can't be directly converted to raw bytes, it will return an error

type StructInfo

type StructInfo struct {
	StructName string
	Fields     []*FieldInfo
	StructSize int64 // types.Sizes interface returns int64
}

Jump to

Keyboard shortcuts

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