golang

package
v0.0.0-...-3e64681 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModRoot

func ModRoot(cwd string) (string, error)

func ModWdRoot

func ModWdRoot() (string, error)

ModWdRoot walks up from current working dir to find the enclosing go module.

func ModulePath

func ModulePath(dir string) (string, error)

ModulePath returns whatever the mod path is.

func NewAPackages

func NewAPackages(packagesVal map[ImportPath]*api.Package) map[string]APackage

func Parse

func Parse(dir string, onlyImports ...string) (*api.Module, error)

Parse the specified directory, which will be the current one, if none was specified by the user. Create an api.Module that describes the contained go files.

func PkgDirs

func PkgDirs(root string) ([]string, error)

PkgDirs returns all directories containing any go file.

func Resolve

func Resolve(m *api.Module) error

func SortMapValues

func SortMapValues[K comparable, V any](m map[K]V, less func(a, b V) bool) []V

Types

type AComment

type AComment struct {
	Raw   string
	Lines []string
}

func NewAComment

func NewAComment(s string) AComment

func (AComment) String

func (ac AComment) String() string

type AConst

type AConst struct {
	api.Constant
}

func NewAConst

func NewAConst(c api.Constant) AConst

func (AConst) String

func (c AConst) String() string

type AConstBlock

type AConstBlock struct {
	api.ConstantBlock
}

func NewAConstBlock

func NewAConstBlock(consts api.ConstantBlock) AConstBlock

func (AConstBlock) String

func (consts AConstBlock) String() string

type AConstBlockList

type AConstBlockList []AConstBlock

func NewAConstBlockList

func NewAConstBlockList(blocks []api.ConstantBlock) AConstBlockList

func (AConstBlockList) String

func (blocks AConstBlockList) String() string

type AConstructors

type AConstructors map[string]AFunction

func NewAConstructors

func NewAConstructors(funcs []*api.Function) AConstructors

func (AConstructors) String

func (c AConstructors) String() string

type ADoc

type ADoc struct {
	AComment
}

func NewADoc

func NewADoc(s string) ADoc

type AField

type AField struct {
	api.Field
}

func NewAField

func NewAField(fieldVal api.Field) AField

func (AField) String

func (f AField) String() string

type AFieldName

type AFieldName string

func (AFieldName) String

func (name AFieldName) String() string

type AFields

type AFields map[string]AField

type AFunction

type AFunction struct {
	api.Function
}

func NewAFunction

func NewAFunction(functionVal api.Function) AFunction

func (AFunction) RefID

func (fn AFunction) RefID() ARefId

func (AFunction) String

func (fn AFunction) String() string

type AFunctionComment

type AFunctionComment string

func (AFunctionComment) String

func (afc AFunctionComment) String() string

type AFunctions

type AFunctions map[string]AFunction

func NewAFunctions

func NewAFunctions(funcs map[string]*api.Function) AFunctions

func (AFunctions) String

func (af AFunctions) String() string

type AGenerics

type AGenerics []AField

func NewAGenerics

func NewAGenerics(generics api.Generics) AGenerics

func (AGenerics) String

func (generics AGenerics) String() string

type AMapType

type AMapType struct {
	api.MapType
}

func (AMapType) String

func (m AMapType) String() string

type AMethod

type AMethod struct {
	api.Method
}

func NewAMethod

func NewAMethod(methodVal api.Method) AMethod

func (AMethod) String

func (m AMethod) String() string

type AMethods

type AMethods map[string]AMethod

func NewAMethods

func NewAMethods(methods []*api.Method) AMethods

func (AMethods) String

func (ms AMethods) String() string

type AModule

type AModule struct {
	Readme   string
	Name     string
	Packages map[ImportPath]APackage
}

func NewAModule

func NewAModule(module api.Module) AModule

func (AModule) AnchorID

func (m AModule) AnchorID() string

func (AModule) String

func (m AModule) String() string

type APackage

type APackage struct {
	api.Package
}

APackage is a decorator struct for the api.Package struct

func NewAPackage

func NewAPackage(packageVal api.Package) APackage

func (APackage) AnchorID

func (p APackage) AnchorID() string

func (APackage) RefID

func (p APackage) RefID() APackageRefID

func (APackage) String

func (p APackage) String() string

type APackageRefID

type APackageRefID struct {
	api.RefId
}

func NewAPackageRefID

func NewAPackageRefID(id api.RefId) APackageRefID

func (APackageRefID) String

func (id APackageRefID) String() string

type ARecv

type ARecv struct {
	*api.Recv
}

func NewARecv

func NewARecv(s *api.Recv) ARecv

func (ARecv) String

func (r ARecv) String() string

type ARefId

type ARefId struct {
	api.RefId
}

func NewARefId

func NewARefId(refId api.RefId) ARefId

func (ARefId) AnchorID

func (r ARefId) AnchorID() string

func (ARefId) String

func (r ARefId) String() string

type AStruct

type AStruct struct {
	api.Struct
}

func NewAStruct

func NewAStruct(structVal api.Struct) AStruct

func (AStruct) AFields

func (s AStruct) AFields() []AField

func (AStruct) String

func (s AStruct) String() string

type AStructs

type AStructs map[string]AStruct

func NewAStructs

func NewAStructs(domainStructs map[string]*api.Struct) AStructs

func (AStructs) String

func (as AStructs) String() string

type ATypeDesc

type ATypeDesc struct {
	api.TypeDesc
}

func NewATypeDesc

func NewATypeDesc(typeDescVal api.TypeDesc) ATypeDesc

func (ATypeDesc) Prefix

func (td ATypeDesc) Prefix() string

func (ATypeDesc) RefId

func (td ATypeDesc) RefId() ARefId

type AVariable

type AVariable struct {
	api.Variable
}

func NewAVariable

func NewAVariable(v api.Variable) AVariable

func (AVariable) AnchorID

func (v AVariable) AnchorID() string

func (AVariable) String

func (v AVariable) String() string

func (AVariable) StringRaw

func (v AVariable) StringRaw() string

type AVariables

type AVariables map[string]AVariable

func NewAVariables

func NewAVariables(vars map[string]*api.Variable) AVariables

func (AVariables) String

func (v AVariables) String() string

type AsciiDocHeader

type AsciiDocHeader struct {
	Attributes []string
}

func NewAsciiDocHeader

func NewAsciiDocHeader() AsciiDocHeader

func (AsciiDocHeader) String

func (h AsciiDocHeader) String() string

type ImportPath

type ImportPath = string

type Package

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

Jump to

Keyboard shortcuts

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