styles

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamingStyles

func NamingStyles() (ns []string)

NamingStyles returns all supported naming styles.

Types

type Apache

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

Apache ports functions adapted from the apache thrift go generator. See https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=compiler/cpp/src/thrift/generate/t_go_generator.cc

func (*Apache) Identify

func (a *Apache) Identify(name string) (string, error)

Identify implements NamingStyle.

func (*Apache) Name added in v0.1.2

func (a *Apache) Name() string

Name implements NamingStyle.

func (*Apache) UseInitialisms

func (a *Apache) UseInitialisms(enable bool)

UseInitialisms implements NamingStyle.

type GoLint

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

GoLint implements a naming conversion algorithm that similar to https://github.com/golang/lint.

func (*GoLint) Identify

func (g *GoLint) Identify(name string) (string, error)

Identify implements NamingStyle.

func (*GoLint) Name added in v0.1.2

func (g *GoLint) Name() string

Name implements NamingStyle.

func (*GoLint) UseInitialisms

func (g *GoLint) UseInitialisms(enable bool)

UseInitialisms implements NamingStyle.

type Naming

type Naming interface {
	Name() string

	Identify(name string) (string, error)

	UseInitialisms(enable bool)
}

Naming determine naming style of the identifier converted from IDL.

func NewNamingStyle

func NewNamingStyle(name string) Naming

NewNamingStyle creates a Naming with the given name. If the given name is supported, this function returns nil.

type ThriftGo

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

ThriftGo is the default naming style of thrifgo.

func (*ThriftGo) Identify

func (tg *ThriftGo) Identify(name string) (string, error)

Identify implements NamingStyle.

func (*ThriftGo) Name added in v0.1.2

func (tg *ThriftGo) Name() string

Name implements NamingStyle.

func (*ThriftGo) UseInitialisms

func (tg *ThriftGo) UseInitialisms(enable bool)

UseInitialisms implements NamingStyle.

Jump to

Keyboard shortcuts

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