lxd: github.com/lxc/lxd/shared/generate/lex Index | Files

package lex

import "github.com/lxc/lxd/shared/generate/lex"


Package Files

case.go config.go form.go lang.go parse.go

func Camel Uses

func Camel(s string) string

Camel converts to camel case ("foo_bar" -> "FooBar")

func Capital Uses

func Capital(s string) string

Capital capitalizes the given string ("foo" -> "Foo")

func Element Uses

func Element(typ string) string

Element is the reverse of Slice, returning the element type name the slice with given type.

func KeyValue Uses

func KeyValue(s string) (string, string, error)

KeyValue extracts the key and value encoded in the given string and separated by '=' (foo=bar -> foo, bar).

func Minuscule Uses

func Minuscule(s string) string

Minuscule turns the first character to lower case ("Foo" -> "foo")

func Parse Uses

func Parse(name string) (*ast.Package, error)

Parse runs the Go parser against the given package name.

func Plural Uses

func Plural(s string) string

Plural converts to plural form ("foo" -> "foos")

func Singular Uses

func Singular(s string) string

Singular converts to singular form ("foos" -> "foo")

func Slice Uses

func Slice(typ string) string

Slice returns the type name of a slice of items of the given type.

func Snake Uses

func Snake(name string) string

Snake converts to snake case ("FooBar" -> "foo_bar")

func Star Uses

func Star(s string) string

Star adds a "*" prefix to the given string.

type MethodSignature Uses

type MethodSignature struct {
    Comment  string    // Method comment
    Name     string    // Method name
    Receiver VarDecl   // Receiver name and type
    Args     []VarDecl // Method arguments
    Return   []string  // Return type

MethodSignature holds information about a method signature.

type VarDecl Uses

type VarDecl struct {
    Name string
    Expr string

VarDecl holds information about a variable declaration

func (VarDecl) String Uses

func (d VarDecl) String() string

Package lex imports 10 packages (graph) and is imported by 15 packages. Updated 2018-10-14. Refresh now. Tools for package owners.