client

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Axios = "axios"
View Source
var BrowserFetch = "browser-fetch"
View Source
var NodeFetch = "node-fetch"

Functions

func GenerateClient

func GenerateClient(specification *spec.Spec, generatePath string, client string, validationName string) *generator.Sources

Types

type AxiosGenerator added in v2.2.0

type AxiosGenerator struct {
	Modules *Modules

	CommonGenerator
	// contains filtered or unexported fields
}

func (*AxiosGenerator) ApiClient added in v2.2.0

func (g *AxiosGenerator) ApiClient(api *spec.Api) *generator.CodeFile

func (*AxiosGenerator) ErrorResponses added in v2.2.0

func (g *AxiosGenerator) ErrorResponses(httpErrors *spec.HttpErrors) *generator.CodeFile

type ClientGenerator

type ClientGenerator interface {
	ApiClient(api *spec.Api) *generator.CodeFile
	ErrorResponses(httpErrors *spec.HttpErrors) *generator.CodeFile
}

type CommonGenerator added in v2.2.0

type CommonGenerator struct {
	Modules *Modules
	// contains filtered or unexported fields
}

func (*CommonGenerator) Errors added in v2.2.0

func (g *CommonGenerator) Errors(httpErrors *spec.HttpErrors) *generator.CodeFile

func (*CommonGenerator) ParamsBuilder added in v2.2.0

func (g *CommonGenerator) ParamsBuilder() *generator.CodeFile

type FetchGenerator added in v2.2.0

type FetchGenerator struct {
	Modules *Modules

	CommonGenerator
	// contains filtered or unexported fields
}

func (*FetchGenerator) ApiClient added in v2.2.0

func (g *FetchGenerator) ApiClient(api *spec.Api) *generator.CodeFile

func (*FetchGenerator) ErrorResponses added in v2.2.0

func (g *FetchGenerator) ErrorResponses(httpErrors *spec.HttpErrors) *generator.CodeFile

type Generator added in v2.2.0

type Generator struct {
	validations.Validation
	CommonGenerator
	ClientGenerator
	Modules *Modules
}

func NewClientGenerator

func NewClientGenerator(client, validationName string, modules *Modules) *Generator

type Modules added in v2.2.0

type Modules struct {
	modules.Modules

	Params   module.Module
	Response module.Module
	// contains filtered or unexported fields
}

func NewModules added in v2.2.0

func NewModules(validationName, generatePath string, specification *spec.Spec) *Modules

func (*Modules) Client added in v2.2.0

func (m *Modules) Client(api *spec.Api) module.Module

Jump to

Keyboard shortcuts

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