model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUnique

func AddUnique(arr []string, values ...string) []string

Types

type Enum

type Enum struct {
	Imports []string `json:"imports"`

	PackageName  string        `json:"packageName"`
	Filename     string        `json:"filename"`
	DocLines     []string      `json:"docLines,omitempty"`
	Name         string        `json:"name,omitempty"`
	EnumLiterals []EnumLiteral `json:"enumLiterals,omitempty"`
	CommentLines []string      `json:"commentLines,omitempty"`
	OnlyComments []string      `json:"onlyComments,omitempty"`
}

@JsonStruct()

func (Enum) FindEnumLiteralByName

func (e Enum) FindEnumLiteralByName(name string) *EnumLiteral

func (Enum) FindEnumLiteralByValue

func (e Enum) FindEnumLiteralByValue(value string) *EnumLiteral

func (Enum) IsEnumLiteralByValueExists

func (s Enum) IsEnumLiteralByValueExists(value string) bool

type EnumLiteral

type EnumLiteral struct {
	Name  string `json:"name"`
	Value string `json:"value,omitempty"`
}

@JsonStruct()

type ExtField

type ExtField struct {
	FullInfo         *Field
	CommentLines     []string
	CommentRightSide []string
	Annotations      []string
}

Pochodzi z daogen (Jako Field) - ale warto zaimplementować globalnie

type Field

type Field struct {
	PackageName  string   `json:"packageName,omitempty"`
	DocLines     []string `json:"docLines,omitempty"`
	Name         string   `json:"name,omitempty"`
	TypeName     string   `json:"typeName,omitempty"`
	IsSlice      bool     `json:"isSlice,omitempty"`
	IsInterface  bool     `json:"isSlice,omitempty"`
	IsPointer    bool     `json:"isPointer,omitempty"`
	Tag          string   `json:"tag,omitempty"`
	CommentLines []string `json:"commentLines,omitempty"`
	OnlyComments []string `json:"onlyComments,omitempty"`
	// wlasne dane uzywane przez dany moduł
	StrValues map[string]string
}

@JsonStruct()

func (*Field) AddMassStrValue

func (f *Field) AddMassStrValue(value string, keys []string)

AddStrValue("true", []string{"klucz1","klucz2","klucz3"...})

func (*Field) AddStrValue

func (f *Field) AddStrValue(key, value string)

func (Field) AsParamDefinition

func (f Field) AsParamDefinition(currentPackageName string) string

jest currentPackageName != nazwy pakietu z ktorego pochodzi pole to: - user []*package.User inaczej: - user []*User

func (Field) AsParamDefinitionCutPointer

func (f Field) AsParamDefinitionCutPointer(currentPackageName string) string

func (*Field) HasValue

func (f *Field) HasValue(key string) bool

func (*Field) HasValueEq

func (f *Field) HasValueEq(key, find string) bool

func (Field) TypeNameAsDefinition

func (f Field) TypeNameAsDefinition() string

func (Field) TypeNameWithPackageNameIfNotSame

func (f Field) TypeNameWithPackageNameIfNotSame(packageName string) string

type Interface

type Interface struct {
	Imports []string `json:"imports"`

	PackageName  string      `json:"packageName"`
	Filename     string      `json:"filename"`
	DocLines     []string    `json:"docLines,omitempty"`
	Name         string      `json:"name"`
	Methods      []Operation `json:"methods,omitempty"`
	CommentLines []string    `json:"commentLines,omitempty"`
	OnlyComments []string    `json:"onlyComments,omitempty"`
}

@JsonStruct()

func (Interface) FindMethodByName

func (i Interface) FindMethodByName(name string) *Operation

func (Interface) IsMethodByNameExists

func (s Interface) IsMethodByNameExists(name string) bool

type LinkedStructs

type LinkedStructs struct {

	// do komunikacji między modułami i twojego wew. użytku
	Values map[string]interface{}
	// contains filtered or unexported fields
}

Moze sluzyc do powiazanie struktur e sobą

func NewLinkedStructs

func NewLinkedStructs() *LinkedStructs

func (*LinkedStructs) AddMassValue

func (c *LinkedStructs) AddMassValue(value interface{}, keys []string)

AddStrValue("true", []string{"klucz1","klucz2","klucz3"...})

func (*LinkedStructs) AddValue

func (c *LinkedStructs) AddValue(key string, value interface{})

func (*LinkedStructs) Append

func (this *LinkedStructs) Append(s *StructInfo)

func (*LinkedStructs) FindStructByModel

func (this *LinkedStructs) FindStructByModel(name string) *StructInfo

func (*LinkedStructs) FindStructByTable

func (this *LinkedStructs) FindStructByTable(name string) *StructInfo

func (*LinkedStructs) GetItems

func (this *LinkedStructs) GetItems() []*StructInfo

func (*LinkedStructs) GetValue

func (c *LinkedStructs) GetValue(key string) string

func (*LinkedStructs) HaveValue

func (this *LinkedStructs) HaveValue(name string) bool

type Operation

type Operation struct {
	Imports          []string `json:"imports"`
	PackageName      string   `json:"packageName,omitempty"`
	Filename         string   `json:"filename,omitempty"`
	DocLines         []string `json:"docLines,omitempty"`
	RelatedStruct    *Field   `json:"relatedStruct,omitempty"` // optional
	StructDefinition *Struct
	Name             string   `json:"name"`
	InputArgs        []Field  `json:"inputArgs,omitempty"`
	OutputArgs       []Field  `json:"outputArgs,omitempty"`
	CommentLines     []string `json:"commentLines,omitempty"`
	OnlyComments     []string `json:"onlyComments,omitempty"`
}

@JsonStruct()

func (Operation) FindInputFieldByName

func (o Operation) FindInputFieldByName(name string) *Field

func (Operation) FindOutputFieldByName

func (o Operation) FindOutputFieldByName(name string) *Field

func (Operation) HaveParams

func (o Operation) HaveParams() bool

func (Operation) HaveReturn

func (o Operation) HaveReturn() bool

type ParsedSources

type ParsedSources struct {
	Structs    []Struct    `json:"structs,omitempty"`
	Operations []Operation `json:"operations,omitempty"`
	Interfaces []Interface `json:"interfaces,omitempty"`
	Typedefs   []Typedef   `json:"typedefs,omitempty"`
	Enums      []Enum      `json:"enums,omitempty"`
	Imports    []string    `json:"imports"`

	FileName map[string]*ParsedSourcesLink
}

@JsonStruct()

func (ParsedSources) FileNames

func (p ParsedSources) FileNames() []string

Nazwy plików, w których znaleźliśmy definicje

type ParsedSourcesLink struct {
	Structs    []*Struct    `json:"structs,omitempty"`
	Operations []*Operation `json:"operations,omitempty"`
	Interfaces []*Interface `json:"interfaces,omitempty"`
	Typedefs   []*Typedef   `json:"typedefs,omitempty"`
	Enums      []*Enum      `json:"enums,omitempty"`
	Imports    []*string    `json:"imports"`
}

type Struct

type Struct struct {
	// możesz sobie coś dopisać (markery to jakieś własne flagi)
	Markers map[string]string
	// w data możesz zbindować co chcesz
	Data interface{}

	PackageName  string       `json:"packageName"`
	Imports      []string     `json:"imports"`
	Filename     string       `json:"filename"`
	DocLines     []string     `json:"docLines,omitempty"`
	Name         string       `json:"name"`
	Fields       []Field      `json:"fields,omitempty"`
	Operations   []*Operation `json:"operations,omitempty"`
	CommentLines []string     `json:"commentLines,omitempty"`
	OnlyComments []string     `json:"onlyComments,omitempty"`
}

@JsonStruct()

func (Struct) FindFieldByName

func (s Struct) FindFieldByName(name string) *Field

func (Struct) FindOperationByName

func (s Struct) FindOperationByName(name string) *Operation

func (Struct) HaveData

func (s Struct) HaveData() bool

func (Struct) HaveMarker

func (s Struct) HaveMarker(name string) bool

func (*Struct) HaveMarkerEq

func (s *Struct) HaveMarkerEq(name string, value string) bool

func (Struct) IsFieldByNameExists

func (s Struct) IsFieldByNameExists(name string) bool

func (Struct) IsOperationByNameExists

func (s Struct) IsOperationByNameExists(name string) bool

func (*Struct) SetMarker

func (s *Struct) SetMarker(name string, value string)

type StructInfo

type StructInfo struct {
	ExtFromStruct    string
	Table            string
	Model            string
	Struct           *Struct
	CommentLines     []string
	Annotations      []string
	CommentRightSide []string
	Fields           []ExtField
}

type Typedef

type Typedef struct {
	Imports []string `json:"imports"`

	PackageName  string   `json:"packageName"`
	Filename     string   `json:"filename"`
	DocLines     []string `json:"docLines,omitempty"`
	Name         string   `json:"name"`
	Type         string   `json:"type,omitempty"`
	OnlyComments []string `json:"onlyComments,omitempty"`
}

@JsonStruct()

Jump to

Keyboard shortcuts

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