common

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsCommentLines

func AsCommentLines(comment string) string

func BasicType

func BasicType(schemaType string, format string, importer *codegen.Importer) string

func PathFromSwaggerPath

func PathFromSwaggerPath(str string) string

func RefName

func RefName(str string) string

func RequestOf

func RequestOf(id string) string

func ResponseOf

func ResponseOf(id string) string

Types

type ClientSet

type ClientSet struct {
	BaseClient string
	Name       string
	PkgName    string
	ClientName string
	Ops        map[string]Op
	Importer   *codegen.Importer
}

func NewClientSet

func NewClientSet(baseClient, name string) *ClientSet

func (*ClientSet) AddOp

func (c *ClientSet) AddOp(op Op)

func (*ClientSet) String

func (c *ClientSet) String() string

func (*ClientSet) WriteAll

func (c *ClientSet) WriteAll(w io.Writer)

func (*ClientSet) WriteOperations

func (c *ClientSet) WriteOperations(w io.Writer)

func (*ClientSet) WriteTypeClient

func (c *ClientSet) WriteTypeClient(w io.Writer)

func (*ClientSet) WriteTypeInterface

func (c *ClientSet) WriteTypeInterface(w io.Writer)

type Field

type Field struct {
	Comment string
	Name    string
	Type    string
	Tags    Tags
}

func NewField

func NewField(name string) *Field

func (*Field) AddTag

func (f *Field) AddTag(tagKey, tagValue string, flags ...string)

func (*Field) Anonymous

func (f *Field) Anonymous() bool

func (*Field) String

func (f *Field) String() string

type Op

type Op interface {
	ID() string
	Method() string
	Path() string
	HasRequest() bool
	WriteReqType(w io.Writer, importer *codegen.Importer)
	WriteRespBodyType(w io.Writer, importer *codegen.Importer)
}

type Tag

type Tag struct {
	Key   string
	Value string
	Flags map[string]bool
}

func NewTag

func NewTag(key, value string) *Tag

func (*Tag) String

func (tag *Tag) String() string

func (Tag) WithFlags

func (tag Tag) WithFlags(flags ...string) *Tag

type Tags

type Tags map[string]*Tag

func (Tags) String

func (tags Tags) String() string

Jump to

Keyboard shortcuts

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