generator

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAPI_GenerateCode_FullMethodName = "/api.generator.v1.ServiceAPI/GenerateCode"
	ServiceAPI_Plugins_FullMethodName      = "/api.generator.v1.ServiceAPI/Plugins"
)

Variables

View Source
var File_api_generator_v1_generator_proto protoreflect.FileDescriptor
View Source
var ServiceAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.generator.v1.ServiceAPI",
	HandlerType: (*ServiceAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GenerateCode",
			Handler:    _ServiceAPI_GenerateCode_Handler,
		},
		{
			MethodName: "Plugins",
			Handler:    _ServiceAPI_Plugins_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/generator/v1/generator.proto",
}

ServiceAPI_ServiceDesc is the grpc.ServiceDesc for ServiceAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServiceAPIServer

func RegisterServiceAPIServer(s grpc.ServiceRegistrar, srv ServiceAPIServer)

Types

type GenerateCodeRequest

type GenerateCodeRequest struct {

	// code_generator_request is the standard protobuf code generator request.
	CodeGeneratorRequest *pluginpb.CodeGeneratorRequest `protobuf:"bytes,1,opt,name=code_generator_request,json=codeGeneratorRequest,proto3" json:"code_generator_request,omitempty"`
	// plugin_name is the name of the plugin to use for generation.
	PluginName string `protobuf:"bytes,2,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"`
	// contains filtered or unexported fields
}

GenerateCodeRequest is the request message for the GenerateCode RPC.

func (*GenerateCodeRequest) Descriptor deprecated

func (*GenerateCodeRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenerateCodeRequest.ProtoReflect.Descriptor instead.

func (*GenerateCodeRequest) GetCodeGeneratorRequest

func (x *GenerateCodeRequest) GetCodeGeneratorRequest() *pluginpb.CodeGeneratorRequest

func (*GenerateCodeRequest) GetPluginName

func (x *GenerateCodeRequest) GetPluginName() string

func (*GenerateCodeRequest) ProtoMessage

func (*GenerateCodeRequest) ProtoMessage()

func (*GenerateCodeRequest) ProtoReflect

func (x *GenerateCodeRequest) ProtoReflect() protoreflect.Message

func (*GenerateCodeRequest) Reset

func (x *GenerateCodeRequest) Reset()

func (*GenerateCodeRequest) String

func (x *GenerateCodeRequest) String() string

type GenerateCodeResponse

type GenerateCodeResponse struct {

	// code_generator_response is the standard protobuf code generator response.
	CodeGeneratorResponse *pluginpb.CodeGeneratorResponse `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

GenerateCodeResponse is the response message for the GenerateCode RPC.

func (*GenerateCodeResponse) Descriptor deprecated

func (*GenerateCodeResponse) Descriptor() ([]byte, []int)

Deprecated: Use GenerateCodeResponse.ProtoReflect.Descriptor instead.

func (*GenerateCodeResponse) GetCodeGeneratorResponse

func (x *GenerateCodeResponse) GetCodeGeneratorResponse() *pluginpb.CodeGeneratorResponse

func (*GenerateCodeResponse) ProtoMessage

func (*GenerateCodeResponse) ProtoMessage()

func (*GenerateCodeResponse) ProtoReflect

func (x *GenerateCodeResponse) ProtoReflect() protoreflect.Message

func (*GenerateCodeResponse) Reset

func (x *GenerateCodeResponse) Reset()

func (*GenerateCodeResponse) String

func (x *GenerateCodeResponse) String() string

type PluginInfo

type PluginInfo struct {

	// id is the unique identifier for the plugin.
	// Example: "123e4567-e89b-12d3-a456-426614174000"
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// group is the group to which the plugin belongs.
	// Example: "protocolbuffers"
	Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	// name is the name of the plugin.
	// Example: "go"
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// version is the version of the plugin.
	// Example: "v1.5.1"
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// created_at is the timestamp when the plugin was installed.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

PluginInfo message represents information about a plugin.

func (*PluginInfo) Descriptor deprecated

func (*PluginInfo) Descriptor() ([]byte, []int)

Deprecated: Use PluginInfo.ProtoReflect.Descriptor instead.

func (*PluginInfo) GetCreatedAt

func (x *PluginInfo) GetCreatedAt() *timestamppb.Timestamp

func (*PluginInfo) GetGroup

func (x *PluginInfo) GetGroup() string

func (*PluginInfo) GetId

func (x *PluginInfo) GetId() string

func (*PluginInfo) GetName

func (x *PluginInfo) GetName() string

func (*PluginInfo) GetVersion

func (x *PluginInfo) GetVersion() string

func (*PluginInfo) ProtoMessage

func (*PluginInfo) ProtoMessage()

func (*PluginInfo) ProtoReflect

func (x *PluginInfo) ProtoReflect() protoreflect.Message

func (*PluginInfo) Reset

func (x *PluginInfo) Reset()

func (*PluginInfo) String

func (x *PluginInfo) String() string

type PluginsRequest

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

PluginsRequest is the request message for the Plugins RPC.

func (*PluginsRequest) Descriptor deprecated

func (*PluginsRequest) Descriptor() ([]byte, []int)

Deprecated: Use PluginsRequest.ProtoReflect.Descriptor instead.

func (*PluginsRequest) ProtoMessage

func (*PluginsRequest) ProtoMessage()

func (*PluginsRequest) ProtoReflect

func (x *PluginsRequest) ProtoReflect() protoreflect.Message

func (*PluginsRequest) Reset

func (x *PluginsRequest) Reset()

func (*PluginsRequest) String

func (x *PluginsRequest) String() string

type PluginsResponse

type PluginsResponse struct {

	// plugins is the list of available plugins.
	Plugins []*PluginInfo `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"`
	// contains filtered or unexported fields
}

PluginsResponse is the response message for the Plugins RPC.

func (*PluginsResponse) Descriptor deprecated

func (*PluginsResponse) Descriptor() ([]byte, []int)

Deprecated: Use PluginsResponse.ProtoReflect.Descriptor instead.

func (*PluginsResponse) GetPlugins

func (x *PluginsResponse) GetPlugins() []*PluginInfo

func (*PluginsResponse) ProtoMessage

func (*PluginsResponse) ProtoMessage()

func (*PluginsResponse) ProtoReflect

func (x *PluginsResponse) ProtoReflect() protoreflect.Message

func (*PluginsResponse) Reset

func (x *PluginsResponse) Reset()

func (*PluginsResponse) String

func (x *PluginsResponse) String() string

type ServiceAPIClient

type ServiceAPIClient interface {
	// GenerateCode generates code using the specified plugin.
	GenerateCode(ctx context.Context, in *GenerateCodeRequest, opts ...grpc.CallOption) (*GenerateCodeResponse, error)
	// Plugins retrieves a list of available plugins.
	Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error)
}

ServiceAPIClient is the client API for ServiceAPI service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

ServiceAPI defines the public API for the generator service.

func NewServiceAPIClient

func NewServiceAPIClient(cc grpc.ClientConnInterface) ServiceAPIClient

type ServiceAPIServer

type ServiceAPIServer interface {
	// GenerateCode generates code using the specified plugin.
	GenerateCode(context.Context, *GenerateCodeRequest) (*GenerateCodeResponse, error)
	// Plugins retrieves a list of available plugins.
	Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error)
}

ServiceAPIServer is the server API for ServiceAPI service. All implementations should embed UnimplementedServiceAPIServer for forward compatibility.

ServiceAPI defines the public API for the generator service.

type UnimplementedServiceAPIServer

type UnimplementedServiceAPIServer struct{}

UnimplementedServiceAPIServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedServiceAPIServer) GenerateCode

func (UnimplementedServiceAPIServer) Plugins

type UnsafeServiceAPIServer

type UnsafeServiceAPIServer interface {
	// contains filtered or unexported methods
}

UnsafeServiceAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceAPIServer will result in compilation errors.

Jump to

Keyboard shortcuts

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