protocontract

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Package    string
	GoPackage  string
	HeaderPath string

	Messages     []string
	ImportsPaths []string

	Services []Service
}

type Contract

type Contract struct {
	Base

	Desc *desc.FileDescriptor
}

Contract represents contract files with scope.

`HeaderPath` stores main contract path.
`[]ImportsPaths` stores paths of contracts which was imported in the main contract file.

func FromProtoDescriptor

func FromProtoDescriptor(descriptor *desc.FileDescriptor, protoPath string) (Contract, error)

FromProtoDescriptor converts proto descriptor into Contract model.

func (Contract) HasMethods

func (c Contract) HasMethods() bool

func (Contract) IsProtoContract

func (c Contract) IsProtoContract() bool

type MessageType

type MessageType struct {
	Name      string
	Package   string
	GoPackage string

	IsExternal bool
}

type Method

type Method struct {
	Name    string
	Package string

	InType  MessageType
	OutType MessageType

	MethodType types.ProtoMethodType
}

type Service

type Service struct {
	Name      string
	GoPackage string

	Methods []Method
}

type SetOfContracts

type SetOfContracts []Contract

SetOfContracts is just alias for several contracts.

func (SetOfContracts) HasContractsWithMethods

func (set SetOfContracts) HasContractsWithMethods() bool

func (SetOfContracts) HasContractsWithProto

func (set SetOfContracts) HasContractsWithProto() bool

func (SetOfContracts) WithMethodsOnly

func (set SetOfContracts) WithMethodsOnly() SetOfContracts

WithMethodsOnly returns only contracts with methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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