swipe

package module
v1.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 18 Imported by: 0

README

Swipe

Swipe is a code generation tool that automates the creation of repetitively used code. Configuration parameters are presented in Swipe as parameters of the Golang function, using explicit initialization instead of global variables or reflections.

Installation

To install Swipe, follow these steps:

go get github.com/swipeio/swipe/cmd/swipe

check that "$GOPATH/bin "is added to your "$PATH".

Documentation

User guide

Frequently asked questions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(opt Option)

Types

type ConfigParams

type ConfigParams struct {
	Struct interface{}
}

type GRPCOption

type GRPCOption string

type Generator

type Generator interface {
	Write(opt *parser.Option) error
}

type HTTPClientOption

type HTTPClientOption string

type HTTPMethodOption

type HTTPMethodOption string

func HTTPDecodeRequest

func HTTPDecodeRequest(requestFunc kithttp.DecodeRequestFunc) HTTPMethodOption

func HTTPEncodeResponse

func HTTPEncodeResponse(responseFunc kithttp.EncodeResponseFunc) HTTPMethodOption

func HTTPFastDecodeRequest

func HTTPFastDecodeRequest(requestFunc kitfasthttp.DecodeRequestFunc) HTTPMethodOption

func HTTPFastEncodeResponse

func HTTPFastEncodeResponse(responseFunc kitfasthttp.EncodeResponseFunc) HTTPMethodOption

func HTTPFastServerOption

func HTTPFastServerOption(option ...kitfasthttp.ServerOption) HTTPMethodOption

func HTTPHeaderVars

func HTTPHeaderVars(keyvals ...string) HTTPMethodOption

func HTTPMethod

func HTTPMethod(string) HTTPMethodOption

func HTTPPath

func HTTPPath(string) HTTPMethodOption

func HTTPQueryVars

func HTTPQueryVars(keyvals ...string) HTTPMethodOption

func HTTPServerOption

func HTTPServerOption(option ...kithttp.ServerOption) HTTPMethodOption

type HTTPOption

type HTTPOption string

func HTTPClient

func HTTPClient(opts ...HTTPClientOption) HTTPOption

func HTTPFast

func HTTPFast(opts ...HTTPClientOption) HTTPOption

func HTTPJsonRPC

func HTTPJsonRPC(string) HTTPOption

func HTTPMethodOptions

func HTTPMethodOptions(method interface{}, opts ...HTTPMethodOption) HTTPOption

func HTTPOpenapiDoc

func HTTPOpenapiDoc(string) HTTPOption

type InstrumentingMiddlewareOption

type InstrumentingMiddlewareOption string

type Interface

type Interface interface{}

type JSONRPCMethodOption

type JSONRPCMethodOption string

type JSONRPCOption

type JSONRPCOption string

type LoggingMiddlewareOption

type LoggingMiddlewareOption string

func Logger

func Logger(logger interface{}) LoggingMiddlewareOption

type Option

type Option string

func ConfigEnv

func ConfigEnv(s interface{}, funcName string) Option

ConfigEnv build config.

func Service

func Service(s interface{}, transport ServiceTransport, opts ...ServiceOption) Option

type Result

type Result struct {
	// PkgPath is the package's PkgPath.
	PkgPath string
	// OutputPath is the HTTPPath where the generated output should be written.
	// May be empty if there were errors.
	OutputPath string
	// Content is the gofmt'd source code that was generated. May be nil if
	// there were errors during generation.
	Content []byte
	// Errs is a slice of errors identified during generation.
	Errs []error
}

type ServiceMiddlewareOption

type ServiceMiddlewareOption string

type ServiceOption

type ServiceOption string

func EndpointMiddleware

func EndpointMiddleware(middleware endpoint.Middleware, methods ...interface{}) ServiceOption

func InstrumentingMiddleware

func InstrumentingMiddleware(namespace, subsystem string) ServiceOption

func LoggingMiddleware

func LoggingMiddleware() ServiceOption

func ServiceMiddleware

func ServiceMiddleware(iface interface{}, opts ...ServiceMiddlewareOption) ServiceOption

type ServiceTransport

type ServiceTransport string

func GRPC

func GRPC(server interface{}, opts ...GRPCOption) ServiceTransport

func HTTP

func HTTP(opts ...HTTPOption) ServiceTransport

type Swipe

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

func NewSwipe

func NewSwipe(ctx context.Context, wd string, env []string, patterns []string) *Swipe

func (*Swipe) Generate

func (s *Swipe) Generate() ([]Result, []error)

type TransportOption

type TransportOption string

Jump to

Keyboard shortcuts

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