basecontract

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenAPIFromAny

func OpenAPIFromAny(contract Contract) (*openapi3.T, error)

func ProtoFromAny

func ProtoFromAny(contract Contract) (*desc.FileDescriptor, error)

Types

type Contract

type Contract struct {
	HeaderPath string

	ImportsPaths []string

	ContractHasMethods bool
	// contains filtered or unexported fields
}

func FromOpenAPIDescriptor

func FromOpenAPIDescriptor(descriptor *openapi3.T, path string) (Contract, error)

func FromProtoDescriptor

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

FromProtoDescriptor converts proto descriptor into Contract model.

func (Contract) Descriptor

func (c Contract) Descriptor() any

func (Contract) HasMethods

func (c Contract) HasMethods() bool

func (Contract) IsOpenAPIContract

func (c Contract) IsOpenAPIContract() bool

func (Contract) IsProtoContract

func (c Contract) IsProtoContract() bool

type SetOfContracts

type SetOfContracts []Contract

SetOfContracts is just alias for several contracts.

func (SetOfContracts) FileType

func (set SetOfContracts) FileType() types.SourceFileType

func (SetOfContracts) HasContractsWithMethods

func (set SetOfContracts) HasContractsWithMethods() bool

func (SetOfContracts) WithMethodsOnly

func (set SetOfContracts) WithMethodsOnly() SetOfContracts

WithMethodsOnly returns only contracts with methods.

Directories

Path Synopsis
parser

Jump to

Keyboard shortcuts

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