Major refactoring
This commit is contained in:
280
proto/v1/hook.pb.go
Normal file
280
proto/v1/hook.pb.go
Normal file
@@ -0,0 +1,280 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v6.30.2
|
||||
// source: proto/hook.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Hook struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Command []string `protobuf:"bytes,2,rep,name=command,proto3" json:"command,omitempty"`
|
||||
User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
|
||||
Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"`
|
||||
Cwd string `protobuf:"bytes,5,opt,name=cwd,proto3" json:"cwd,omitempty"`
|
||||
TimeoutSeconds int32 `protobuf:"varint,6,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"`
|
||||
Env map[string]string `protobuf:"bytes,7,rep,name=env,proto3" json:"env,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Hook) Reset() {
|
||||
*x = Hook{}
|
||||
mi := &file_proto_hook_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Hook) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Hook) ProtoMessage() {}
|
||||
|
||||
func (x *Hook) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_hook_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Hook.ProtoReflect.Descriptor instead.
|
||||
func (*Hook) Descriptor() ([]byte, []int) {
|
||||
return file_proto_hook_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Hook) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Hook) GetCommand() []string {
|
||||
if x != nil {
|
||||
return x.Command
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Hook) GetUser() string {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Hook) GetGroup() string {
|
||||
if x != nil {
|
||||
return x.Group
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Hook) GetCwd() string {
|
||||
if x != nil {
|
||||
return x.Cwd
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Hook) GetTimeoutSeconds() int32 {
|
||||
if x != nil {
|
||||
return x.TimeoutSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Hook) GetEnv() map[string]string {
|
||||
if x != nil {
|
||||
return x.Env
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecuteHookRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Hook *Hook `protobuf:"bytes,1,opt,name=hook,proto3" json:"hook,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ExecuteHookRequest) Reset() {
|
||||
*x = ExecuteHookRequest{}
|
||||
mi := &file_proto_hook_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ExecuteHookRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExecuteHookRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_hook_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExecuteHookRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ExecuteHookRequest) Descriptor() ([]byte, []int) {
|
||||
return file_proto_hook_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ExecuteHookRequest) GetHook() *Hook {
|
||||
if x != nil {
|
||||
return x.Hook
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExecuteHookResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ExecuteHookResponse) Reset() {
|
||||
*x = ExecuteHookResponse{}
|
||||
mi := &file_proto_hook_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ExecuteHookResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExecuteHookResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_hook_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExecuteHookResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ExecuteHookResponse) Descriptor() ([]byte, []int) {
|
||||
return file_proto_hook_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ExecuteHookResponse) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_proto_hook_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_proto_hook_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x10proto/hook.proto\x12\bhooks.v1\"\xfc\x01\n" +
|
||||
"\x04Hook\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" +
|
||||
"\acommand\x18\x02 \x03(\tR\acommand\x12\x12\n" +
|
||||
"\x04user\x18\x03 \x01(\tR\x04user\x12\x14\n" +
|
||||
"\x05group\x18\x04 \x01(\tR\x05group\x12\x10\n" +
|
||||
"\x03cwd\x18\x05 \x01(\tR\x03cwd\x12'\n" +
|
||||
"\x0ftimeout_seconds\x18\x06 \x01(\x05R\x0etimeoutSeconds\x12)\n" +
|
||||
"\x03env\x18\a \x03(\v2\x17.hooks.v1.Hook.EnvEntryR\x03env\x1a6\n" +
|
||||
"\bEnvEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"8\n" +
|
||||
"\x12ExecuteHookRequest\x12\"\n" +
|
||||
"\x04hook\x18\x01 \x01(\v2\x0e.hooks.v1.HookR\x04hook\"+\n" +
|
||||
"\x13ExecuteHookResponse\x12\x14\n" +
|
||||
"\x05error\x18\x01 \x01(\tR\x05error2Y\n" +
|
||||
"\vHookService\x12J\n" +
|
||||
"\vExecuteHook\x12\x1c.hooks.v1.ExecuteHookRequest\x1a\x1d.hooks.v1.ExecuteHookResponseB\x05Z\x03/v1b\x06proto3"
|
||||
|
||||
var (
|
||||
file_proto_hook_proto_rawDescOnce sync.Once
|
||||
file_proto_hook_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_proto_hook_proto_rawDescGZIP() []byte {
|
||||
file_proto_hook_proto_rawDescOnce.Do(func() {
|
||||
file_proto_hook_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_hook_proto_rawDesc), len(file_proto_hook_proto_rawDesc)))
|
||||
})
|
||||
return file_proto_hook_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_hook_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_proto_hook_proto_goTypes = []any{
|
||||
(*Hook)(nil), // 0: hooks.v1.Hook
|
||||
(*ExecuteHookRequest)(nil), // 1: hooks.v1.ExecuteHookRequest
|
||||
(*ExecuteHookResponse)(nil), // 2: hooks.v1.ExecuteHookResponse
|
||||
nil, // 3: hooks.v1.Hook.EnvEntry
|
||||
}
|
||||
var file_proto_hook_proto_depIdxs = []int32{
|
||||
3, // 0: hooks.v1.Hook.env:type_name -> hooks.v1.Hook.EnvEntry
|
||||
0, // 1: hooks.v1.ExecuteHookRequest.hook:type_name -> hooks.v1.Hook
|
||||
1, // 2: hooks.v1.HookService.ExecuteHook:input_type -> hooks.v1.ExecuteHookRequest
|
||||
2, // 3: hooks.v1.HookService.ExecuteHook:output_type -> hooks.v1.ExecuteHookResponse
|
||||
3, // [3:4] is the sub-list for method output_type
|
||||
2, // [2:3] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_hook_proto_init() }
|
||||
func file_proto_hook_proto_init() {
|
||||
if File_proto_hook_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_hook_proto_rawDesc), len(file_proto_hook_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_proto_hook_proto_goTypes,
|
||||
DependencyIndexes: file_proto_hook_proto_depIdxs,
|
||||
MessageInfos: file_proto_hook_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_hook_proto = out.File
|
||||
file_proto_hook_proto_goTypes = nil
|
||||
file_proto_hook_proto_depIdxs = nil
|
||||
}
|
||||
Reference in New Issue
Block a user