converter

package
v0.0.0-...-bd94565 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Constructors = fx.Provide(
	NewFxContainer,
	fx.Annotated{
		Group:  "container",
		Target: NewFxOa2Converter,
	},
	fx.Annotated{
		Group:  "container",
		Target: NewFxOa3Converter,
	},
)
View Source
var (
	ErrUnsupportedConverterType = errors.New("unsupported spec type")
)

Functions

This section is empty.

Types

type Container

type Container map[common.SpecType]Converter

func NewFxContainer

func NewFxContainer(in ContainerFxIn) Container

func (Container) Get

func (c Container) Get(specType common.SpecType) (Converter, error)

type ContainerFxIn

type ContainerFxIn struct {
	fx.In
	Converters []Converter `group:"container"`
}

type Converter

type Converter interface {
	GetType() common.SpecType
	Convert(ctx context.Context, arguments common.Arguments) (common.TemplateContainer, error)
}

func NewFxOa2Converter

func NewFxOa2Converter(
	loggerFactory common.LoggerFactory,
) Converter

func NewFxOa3Converter

func NewFxOa3Converter() Converter

type XOperationExample

type XOperationExample struct {
	Request        XOperationRequestExample  `json:"request"`
	Response       XOperationResponseExample `json:"response"`
	Tags           []string                  `json:"tags"`
	Priority       int                       `json:"priority"`
	PostProcessors []common.PostProcessor    `json:"post_processors"`
}

type XOperationExamples

type XOperationExamples map[string]XOperationExample

type XOperationRequestExample

type XOperationRequestExample struct {
	Headers    map[string]interface{} `json:"headers"`
	Parameters map[string]interface{} `json:"parameters"`
}

type XOperationResponseExample

type XOperationResponseExample struct {
	StatusCode int                    `json:"status_code"`
	Body       map[string]interface{} `json:"body"`
}

Jump to

Keyboard shortcuts

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