package
1.4.1-hotfix-maintenence
Repository: https://github.com/uber/zanzibar.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

CamelCase converts the given string to camel case.
CamelToSnake converts a given string to snake case, based on https://github.com/serenize/snaker/blob/master/snaker.go.
ClientMockGenHook returns a PostGenHook to generate client mocks.
FindClientsWithFixture finds the given module's dependent clients that have fixture config.
FormatGoFile reformat the go file imports.
GenerateDependencyStruct generates a module struct with placeholders for the instance module based on the defined dependency configuration.
GenerateInitializer generates a file that initializes a module fully recursively, i.e.
GetClientQPSLevels gets mapping from client's circuit breaker name to qps level.
GetListOfAllFilesInEndpointDir gets all the endpoint config files takes empty filesList array as parameter to add to during recursion.
GoCustomType returns the user-defined Go type with its importing package.
GoReferenceType returns the Go reference type string representation for the given thrift type.
GoType returns the Go type string representation for the given thrift type.
IsPointerType determines if the passed in string is a string for a pointer.
IsStructType returns true if the given thrift type is struct, false otherwise.
LintAcronym correct the naming for initialisms.
LowerPascal is Pascal with first char lower.
NewClassConfig unmarshals raw bytes into a ClassConfig struct or return an error if it cannot be unmarshaled into the struct.
NewDefaultModuleSystem creates a fresh instance of the default zanzibar module system (clients, endpoints, services).
NewDefaultModuleSystemWithMockHook creates a fresh instance of the default zanzibar module system (clients, endpoints, services) with a post build hook to generate client and service mocks.
NewDefaultPackageHelperOptions returns a new default PackageHelperOptions, all optional fields are set as default.
NewDefaultTemplate creates a bundle of templates.
NewEndpointSpec creates an endpoint spec from a yaml file.
NewGatewayServiceGenerator creates a new gateway service generator.
NewHeaderPropagator returns an instance of HeaderPropagator.
NewMethod creates new method specification.
NewMockgenBin builds the mockgen binary from vendor directory.
NewModuleSpec returns a specification for a thrift module.
NewModuleSystem returns a new module system.
NewPackageHelper creates a package helper.
NewProtoModuleSpec returns a specification for a proto module.
NewServiceSpec creates a service specification from given thrift file path.
NewTemplate returns a template helper for the provided asset collection.
NewTypeConverter returns *TypeConverter (tc) @optionalEntries contains Entries that already set for tc fromFields entry set in @optionalEntries, tc will not raise error when this entry is required for toFields but missing from fromFields.
PascalCase converts the given string to pascal case.
PopulateQPSLevels loops through endpoint dir and gets qps levels.
PrintGenLine prints the module generation process to stdout.
ReflectInterface uses reflection to obtain interface information for each path symbol pair in the pathSympolMap projRoot is the root dir where mockgen is installed as a vendor package.
ServiceMockGenHook returns a PostGenHook to generate service mocks.
UnmarshalEndpointFile unmarshals endpoint file into config.
Unref unrefs a pointer reference.
WorkflowMockGenHook returns a PostGenHook to generate endpoint workflow mocks.
WriteAndFormat writes the data (Go code) to given file path, creates path if it does not exist and formats the file using gofmt.

# Constants

AntHTTPReqDefBoxed annotates a method so that the genereted method takes generated argument directly instead of a struct that warps the argument.
MultiModule defines a module class type with multiple nested directories.
SingleModule defines a module class type that has 1 directory.

# Variables

CommonInitialisms is taken from https://github.com/golang/lint/blob/206c0f020eba0f7fbcfbc467a5eb808037df2ed6/lint.go#L731.

# Structs

BuildResult is the result of running a module generator.
ClassConfig maps onto a YAML configuration for a class type.
ClassConfigBase defines the shared data fields for all class configs.
ClientIDLConfig is the "config" field in the client-config.yaml for HTTP/TChannel/gRPC clients.
ClientMeta ...
ClientSpec holds information about each client in the gateway included its thriftFile and other meta info.
ClientTestFixture saves mocked client request/response for an endpoint test.
CustomClientConfig represents the config for a custom client.
Dependencies lists all dependencies of a module.
EndpointClassConfig represents the specific config for an endpoint group.
EndpointCollectionMeta saves information used to generate an initializer for a collection of endpoints.
EndpointConfig represent the "config" field of endpoint-config.yaml.
EndpointGenerator generates a group of zanzibar endpoints that proxy corresponding clients.
EndpointMeta saves meta data used to render an endpoint.
EndpointSpec holds information about each endpoint in the gateway including its thriftFile and meta data.
EndpointTestFixture saves mocked requests/responses for an endpoint test.
EndpointTestMeta saves meta data used to render an endpoint test.
ErrorSkipCodeGen when thrown modules can be skipped building without failing code gen.
ExceptionSpec contains information about thrift exceptions.
FieldAssignment is responsible to generate an assignment.
FieldMapperEntry defines a source field and optional arguments converting and overriding fields.
Fixture specifies client fixture import path and all scenarios.
FixtureBody is used to create http body in test fixtures.
FixtureHTTPRequest is test fixture for client/endpoint request.
FixtureHTTPResponse is test fixture for http response.
FixtureRequest is test fixture for client/endpoint request.
FixtureResponse is test fixture for client/endpoint response.
GatewayServiceGenerator generates an entry point for a single service as a main.go that bootstraps the service and its dependencies.
GoPackageImport ...
GRPCClientConfig represents the "config" field for a gRPC client-config.yaml.
HeaderFieldInfo contains information about where to store the string from headers into the request/response body.
HeaderPropagator generates function propagates endpoint request headers to client request body.
HTTPClientConfig represents the "config" field for a HTTP client-config.yaml.
IgnorePopulateSpecStageErr when thrown modules can be skipped building while populating spec.
LineBuilder struct just appends/builds lines.
MethodSpec specifies all needed parts to generate code for a method in service.
MiddlewareConfig represents configuration for a middleware as is written in the yaml file.
MiddlewareConfigConfig is the inner config object as prescribed by module_system yaml conventions.
MiddlewareGenerator generates a group of zanzibar endpoints that proxy corresponding clients.
MiddlewareSpec holds information about each middleware at the endpoint.
MockgenBin is a struct abstracts the mockgen binary built from mockgen package in vendor.
ModuleClass defines a module class in the build configuration directory.
ModuleClassConfig represents the generic YAML config for all modules.
ModuleDependency defines a module instance required by another instance.
ModuleInstance is a configured module inside a module class directory.
ModuleSpec collects the service specifications from thrift file.
ModuleSystem defines the module classes and their type generators.
Options Provides the features that are enabled while generating the build.
PackageHelper manages the mapping from idl file to generated type code and service code.
PackageHelperOptions set the optional configurations for the project package.
PackageInfo provides information about the package associated with a module instance.
PathSegment represents a part of the http path.
ProtoMessage is an internal representation of a Proto Message.
ProtoModule is an internal representation of a parsed Proto file.
ProtoRPC is an internal representation of Proto RPC method and its request/response types.
ProtoService is an internal representation of Proto service and methods in that service.
ServiceSpec specifies a service.
StatusCode is for http status code with exception message.
StructMeta saves information to generate an endpoint's thrift structs file.
StructSpec specifies a Go struct to be generated.
TChannelClientConfig represents the "config" field for a TChannel client-config.yaml.
Template generates code for edge gateway clients and edgegateway endpoints.
TypeConverter can generate a function body that converts two thriftrw FieldGroups from one to another.
TypedHeader is typed header for headers resolved from header schema.

# Interfaces

AssetProvider provides access to template assets.
BuildGenerator provides a function to generate a module instance build artifact from its configuration as part of a build step.
PackageNameResolver interface allows for resolving what the package name for a thrift file is.
SpecProvider is a generator that can provide a specification without running the build step.

# Type aliases

BodyType can either be `json` or `string`.
FixtureBlob implements default string used for (http | tchannel) request/response.
FixtureHeaders implements default string used for headers.
HTTPMethodType can only be valid http method.
PostGenHook provides a way to do work after the build is generated, useful to augment the build, e.g.
ProtocalType can either be `http` or `tchannel`.
Services is list of ProtoServices.
ServiceSpecs is a list of ServiceSpecs.