model

package
v0.0.0-...-eae1ca4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StructFieldModel

type StructFieldModel struct {
	Name      string // field name
	Type      string // field type
	StructTag string // field struct tag without “
}

description of field of structure

func (*StructFieldModel) GetTags

func (sfm *StructFieldModel) GetTags() map[string]string

get field's struct tags as KV map

type StructMethodArg

type StructMethodArg struct {
	Index int
	Name  string
	Type  string
}

method acceping/return argument

type StructMethodModel

type StructMethodModel struct {
	Name       string // method name
	Returnings []StructMethodArg
	Arguments  []StructMethodArg
	Comments   []string
}

description of structure method

func (*StructMethodModel) GetCommentsWithPrefix

func (sm *StructMethodModel) GetCommentsWithPrefix(prefix string) []string

get all structure comments with given prefix, including it

func (*StructMethodModel) HasComment

func (sm *StructMethodModel) HasComment(comment string) bool

whether structure contains given comment

func (*StructMethodModel) HasCommentWithPrefix

func (sm *StructMethodModel) HasCommentWithPrefix(prefix string) bool

whether structure has comment with prefix

type StructModel

type StructModel struct {
	Name     string              // typename of structure
	Comments []string            // list of comments above structure, without // and trimmed
	Fields   []StructFieldModel  // list of fields
	Methods  []StructMethodModel // list of methods
}

description of struct

func (*StructModel) GetCommentsWithPrefix

func (sm *StructModel) GetCommentsWithPrefix(prefix string) []string

get all structure comments with given prefix, including it

func (*StructModel) HasComment

func (sm *StructModel) HasComment(comment string) bool

whether structure contains given comment

func (*StructModel) HasCommentWithPrefix

func (sm *StructModel) HasCommentWithPrefix(prefix string) bool

whether structure has comment with prefix

Jump to

Keyboard shortcuts

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