writers

package
v6.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAngular added in v6.11.0

func GenerateAngular(descriptor *gen.APIDescriptor, pkgDir string) ([]string, error)

Generate API metadata, drives the metadata writer.

func GenerateClient added in v6.11.0

func GenerateClient(version string, descriptor *gen.APIDescriptor, codegen, pkg string) error

Generate API client code, drives the code writer.

func GenerateMetadata added in v6.11.0

func GenerateMetadata(descriptor *gen.APIDescriptor, codegen, pkg string) error

Generate API metadata, drives the metadata writer.

Types

type AngularWriter

type AngularWriter struct {
	// contains filtered or unexported fields
}

AngularWriter struct exposes methods to generate the angular JS services code

func NewAngularWriter

func NewAngularWriter() (*AngularWriter, error)

NewAngularWriter creates a new code writer that generates angular.js types.

func (*AngularWriter) WriteResource

func (c *AngularWriter) WriteResource(resource *gen.Resource, w io.Writer) error

WriteResource writes the code for a resource.

type ClientWriter

type ClientWriter struct {
	// contains filtered or unexported fields
}

ClientWriter struct exposes methods to generate the go API client code

func NewClientWriter

func NewClientWriter() (*ClientWriter, error)

NewClientWriter is the client writer factory.

func (*ClientWriter) WriteHeader

func (c *ClientWriter) WriteHeader(pkg, version string, needTime, needJSON bool, w io.Writer) error

WriteHeader writes the header text.

func (*ClientWriter) WriteResource

func (c *ClientWriter) WriteResource(resource *gen.Resource, w io.Writer) error

WriteResource writest the code for a resource.

func (*ClientWriter) WriteResourceHeader

func (c *ClientWriter) WriteResourceHeader(name string, w io.Writer)

WriteResourceHeader writes the resource header.

func (*ClientWriter) WriteType

func (c *ClientWriter) WriteType(o *gen.ObjectDataType, w io.Writer)

WriteType writest the type declaration for a resource action arguments.

func (*ClientWriter) WriteTypeSectionHeader

func (c *ClientWriter) WriteTypeSectionHeader(w io.Writer)

WriteTypeSectionHeader writes the separator between resources and data types.

type MetadataWriter

type MetadataWriter struct {
	// contains filtered or unexported fields
}

MetadataWriter struct exposes methods to generate the go API client command line tool

func NewMetadataWriter

func NewMetadataWriter() (*MetadataWriter, error)

NewMetadataWriter creates a new writer that generates metadata data structures.

func (*MetadataWriter) WriteHeader

func (c *MetadataWriter) WriteHeader(pkg string, w io.Writer) error

WriteHeader writes the generic header text.

func (*MetadataWriter) WriteMetadata

func (c *MetadataWriter) WriteMetadata(d *gen.APIDescriptor, w io.Writer) error

WriteMetadata writes the data structures that describe the API resources and actions.

Directories

Path Synopsis
Package text provides rudimentary functions for manipulating text in paragraphs.
Package text provides rudimentary functions for manipulating text in paragraphs.

Jump to

Keyboard shortcuts

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