swipe

package module
v1.0.0-alpha10 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 17 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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(Option)

Types

type ClientOption

type ClientOption string

type ConfigEnvOption

type ConfigEnvOption string

func FuncName

func FuncName(string) ConfigEnvOption

func Struct

func Struct(interface{}) ConfigEnvOption

type ConfigParams

type ConfigParams struct {
	Struct interface{}
}

type Generator

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

type InstrumentingMiddlewareOption

type InstrumentingMiddlewareOption string

type InstrumentingOption

type InstrumentingOption string

func Namespace

func Namespace(string) InstrumentingOption

func Subsystem

func Subsystem(string) InstrumentingOption

type JsonRPCOption

type JsonRPCOption string

func JsonRPCPath

func JsonRPCPath(string) JsonRPCOption

type LoggingMiddlewareOption

type LoggingMiddlewareOption string

type MethodOption

type MethodOption string

func HTTPFastServerOption

func HTTPFastServerOption(...kitfasthttp.ServerOption) MethodOption

func HTTPHeaderVars

func HTTPHeaderVars([]string) MethodOption

func HTTPMethod

func HTTPMethod(string) MethodOption

func HTTPPath

func HTTPPath(string) MethodOption

func HTTPQueryVars

func HTTPQueryVars([]string) MethodOption

func HTTPServerOption

func HTTPServerOption(...kithttp.ServerOption) MethodOption

func Signature

func Signature(interface{}) MethodOption

type OpenapiOption

type OpenapiOption string

func OpenapiContactEmail

func OpenapiContactEmail(string) OpenapiOption

func OpenapiContactName

func OpenapiContactName(string) OpenapiOption

func OpenapiContactURL

func OpenapiContactURL(string) OpenapiOption

func OpenapiDescription

func OpenapiDescription(string) OpenapiOption

func OpenapiLicenceName

func OpenapiLicenceName(string) OpenapiOption

func OpenapiLicenceURL

func OpenapiLicenceURL(string) OpenapiOption

func OpenapiOutput

func OpenapiOutput(string) OpenapiOption

func OpenapiTitle

func OpenapiTitle(string) OpenapiOption

func OpenapiVersion

func OpenapiVersion(string) OpenapiOption

type Option

type Option string

func ConfigEnv

func ConfigEnv(...ConfigEnvOption) Option

ConfigEnv build config.

func Service

func Service(...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 Instrumenting

func Instrumenting(...InstrumentingOption) ServiceOption

func Interface

func Interface(interface{}) ServiceOption

func Logging

func Logging() ServiceOption

func Transport

func Transport(...TransportOption) ServiceOption

type ServiceTransport

type ServiceTransport string

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

func Client

func Client(opts ...ClientOption) TransportOption

func HTTPFast

func HTTPFast() TransportOption

func JsonRPC

func JsonRPC(...JsonRPCOption) TransportOption

func MethodOptions

func MethodOptions(...MethodOption) TransportOption

func Openapi

func Openapi(...OpenapiOption) TransportOption

func Protocol

func Protocol(string) TransportOption

Jump to

Keyboard shortcuts

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