Documentation ¶
Index ¶
- func DefaultValueAsString(t types.Type, config Config) (string, error)
- func FailErr(err error)
- func FindAbsolutePathFromRelative(relativePath string) string
- func FindFirstLetterIndex(input string) int
- func FlattenType(typ types.Type) types.Type
- func GenerateClientConAndDisconnMethod(generatorConfig Config) jen.Code
- func GenerateClientMethods(generatorConfig Config) jen.Code
- func GenerateForInterface(config InitConfig) error
- func GenerateMainStruct(generatorConfig Config) jen.Code
- func GenerateServiceMethods(generatorConfig Config) jen.Code
- func GenerateServiceMethodsSwitchCase(config Config, method *types.Func, stmt *jen.Statement)
- func GenerateStartAndStopServiceMethod(generatorConfig Config) jen.Code
- func GetPackageInfo(typ types.Type) (string, string)
- func GetPathAndQualifiedName(sourceType string, config Config) (string, string)
- func IsGobSerializable(interfaceType *types.Interface) bool
- func IsGobType(typ types.Type) bool
- func IsNamedType(t types.Type, path, name string) bool
- func ListImplementations(interfacePkgs []*packages.Package, interfaceName string) ([]types.Type, error)
- func LoadPackage(path string) *packages.Package
- func LoadRepository() ([]*packages.Package, error)
- func RequiresQual(sourceType string) bool
- func SplitSourceType(sourceType string) (string, string)
- type Config
- type InitConfig
- type MethodDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultValueAsString ¶
DefaultValueAsString generates the default value for a given types.Type and returns it as a string.
func FindAbsolutePathFromRelative ¶
FindAbsolutePathFromRelative finds the absolute path from a relative path.
func FindFirstLetterIndex ¶
FindFirstLetterIndex is a helper function to find the index of the first letter in a string.
func FlattenType ¶
FlattenType recursively expands composite types until primitive types are reached.
func GenerateClientConAndDisconnMethod ¶
GenerateClientConAndDisconnMethod generates the connect and disconnect methods for the client.
func GenerateClientMethods ¶
GenerateClientMethods generates the RPC methods for the client.
func GenerateForInterface ¶
func GenerateForInterface( config InitConfig, ) error
GenerateServiceMethods generates the RPC methods for the service.
func GenerateMainStruct ¶
GenerateMainStruct generates the main struct for the service and client.
func GenerateServiceMethods ¶
GenerateServiceMethods generates the service methods.
func GenerateServiceMethodsSwitchCase ¶
GenerateServiceMethodsSwitchCase generates the switch cases to handle different message types.
func GenerateStartAndStopServiceMethod ¶
Generate the start and stop service methods.
func GetPackageInfo ¶
GetPackageInfo returns the full import path and package name of a given type.
func GetPathAndQualifiedName ¶
GetPathAndQualifiedName returns the package path and type name of a given type.
func IsGobSerializable ¶
IsGobSerializable checks if all methods of the given interface type only contain data that's serializable by encoding/gob.
func IsNamedType ¶
isNamedType reports whether t is the named type path.name.
func ListImplementations ¶
func ListImplementations( interfacePkgs []*packages.Package, interfaceName string, ) ([]types.Type, error)
ListImplementations returns a list of types that implement the given interface.
func LoadPackage ¶
LoadPackage loads the package and returns the package.
func LoadRepository ¶
LoadRepository loads the repository and returns the packages.
func RequiresQual ¶
RequiresQual determines if the source type requires a qualified name.
func SplitSourceType ¶
SplitSourceType splits the source type into package and type name.
Types ¶
type InitConfig ¶
type MethodDetails ¶
type MethodDetails struct {
// contains filtered or unexported fields
}