+440
-91
@@ -24,11 +24,10 @@ const (
|
||||
type Item struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // monitor | response
|
||||
Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // monitor: text | percentage
|
||||
Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` // monitor: last output
|
||||
Args int32 `protobuf:"varint,5,opt,name=args,proto3" json:"args,omitempty"` // response: arg count
|
||||
ArgTypes []string `protobuf:"bytes,6,rep,name=arg_types,json=argTypes,proto3" json:"arg_types,omitempty"` // response: text | number per arg
|
||||
Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // monitor: text | percentage
|
||||
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // monitor: last output
|
||||
Args int32 `protobuf:"varint,4,opt,name=args,proto3" json:"args,omitempty"` // exec: arg count
|
||||
ArgTypes []string `protobuf:"bytes,5,rep,name=arg_types,json=argTypes,proto3" json:"arg_types,omitempty"` // exec: text | number per arg
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -70,13 +69,6 @@ func (x *Item) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Item) GetData() string {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
@@ -105,29 +97,28 @@ func (x *Item) GetArgTypes() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Section struct {
|
||||
type Link struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"`
|
||||
Items []*Item `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"`
|
||||
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Section) Reset() {
|
||||
*x = Section{}
|
||||
func (x *Link) Reset() {
|
||||
*x = Link{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Section) String() string {
|
||||
func (x *Link) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Section) ProtoMessage() {}
|
||||
func (*Link) ProtoMessage() {}
|
||||
|
||||
func (x *Section) ProtoReflect() protoreflect.Message {
|
||||
func (x *Link) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -139,52 +130,45 @@ func (x *Section) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Section.ProtoReflect.Descriptor instead.
|
||||
func (*Section) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use Link.ProtoReflect.Descriptor instead.
|
||||
func (*Link) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Section) GetName() string {
|
||||
func (x *Link) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Section) GetIcon() string {
|
||||
func (x *Link) GetUrl() string {
|
||||
if x != nil {
|
||||
return x.Icon
|
||||
return x.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Section) GetItems() []*Item {
|
||||
if x != nil {
|
||||
return x.Items
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ListSectionsRequest struct {
|
||||
type ListContentRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSectionsRequest) Reset() {
|
||||
*x = ListSectionsRequest{}
|
||||
func (x *ListContentRequest) Reset() {
|
||||
*x = ListContentRequest{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSectionsRequest) String() string {
|
||||
func (x *ListContentRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSectionsRequest) ProtoMessage() {}
|
||||
func (*ListContentRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListSectionsRequest) ProtoReflect() protoreflect.Message {
|
||||
func (x *ListContentRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -196,32 +180,34 @@ func (x *ListSectionsRequest) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSectionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListSectionsRequest) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ListContentRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListContentRequest) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type ListSectionsResponse struct {
|
||||
type ListContentResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Sections []*Section `protobuf:"bytes,1,rep,name=sections,proto3" json:"sections,omitempty"`
|
||||
Links []*Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"`
|
||||
Monitors []*Item `protobuf:"bytes,2,rep,name=monitors,proto3" json:"monitors,omitempty"`
|
||||
Exec []*Item `protobuf:"bytes,3,rep,name=exec,proto3" json:"exec,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListSectionsResponse) Reset() {
|
||||
*x = ListSectionsResponse{}
|
||||
func (x *ListContentResponse) Reset() {
|
||||
*x = ListContentResponse{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListSectionsResponse) String() string {
|
||||
func (x *ListContentResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListSectionsResponse) ProtoMessage() {}
|
||||
func (*ListContentResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListSectionsResponse) ProtoReflect() protoreflect.Message {
|
||||
func (x *ListContentResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -233,18 +219,348 @@ func (x *ListSectionsResponse) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListSectionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListSectionsResponse) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use ListContentResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListContentResponse) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListSectionsResponse) GetSections() []*Section {
|
||||
func (x *ListContentResponse) GetLinks() []*Link {
|
||||
if x != nil {
|
||||
return x.Sections
|
||||
return x.Links
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListContentResponse) GetMonitors() []*Item {
|
||||
if x != nil {
|
||||
return x.Monitors
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListContentResponse) GetExec() []*Item {
|
||||
if x != nil {
|
||||
return x.Exec
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DocMeta struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` // sha256 hex of content
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DocMeta) Reset() {
|
||||
*x = DocMeta{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DocMeta) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DocMeta) ProtoMessage() {}
|
||||
|
||||
func (x *DocMeta) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[4]
|
||||
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 DocMeta.ProtoReflect.Descriptor instead.
|
||||
func (*DocMeta) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *DocMeta) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DocMeta) GetHash() string {
|
||||
if x != nil {
|
||||
return x.Hash
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListDocsRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListDocsRequest) Reset() {
|
||||
*x = ListDocsRequest{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListDocsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListDocsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListDocsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[5]
|
||||
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 ListDocsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListDocsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
type ListDocsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Docs []*DocMeta `protobuf:"bytes,1,rep,name=docs,proto3" json:"docs,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ListDocsResponse) Reset() {
|
||||
*x = ListDocsResponse{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ListDocsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListDocsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListDocsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[6]
|
||||
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 ListDocsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListDocsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *ListDocsResponse) GetDocs() []*DocMeta {
|
||||
if x != nil {
|
||||
return x.Docs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetDocRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetDocRequest) Reset() {
|
||||
*x = GetDocRequest{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetDocRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetDocRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetDocRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[7]
|
||||
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 GetDocRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetDocRequest) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *GetDocRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetDocResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetDocResponse) Reset() {
|
||||
*x = GetDocResponse{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetDocResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetDocResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetDocResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[8]
|
||||
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 GetDocResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetDocResponse) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *GetDocResponse) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SaveDocRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SaveDocRequest) Reset() {
|
||||
*x = SaveDocRequest{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SaveDocRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SaveDocRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SaveDocRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[9]
|
||||
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 SaveDocRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SaveDocRequest) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *SaveDocRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SaveDocRequest) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SaveDocResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SaveDocResponse) Reset() {
|
||||
*x = SaveDocResponse{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SaveDocResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SaveDocResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SaveDocResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[10]
|
||||
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 SaveDocResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SaveDocResponse) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *SaveDocResponse) GetHash() string {
|
||||
if x != nil {
|
||||
return x.Hash
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type RunScriptRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
@@ -255,7 +571,7 @@ type RunScriptRequest struct {
|
||||
|
||||
func (x *RunScriptRequest) Reset() {
|
||||
*x = RunScriptRequest{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[4]
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -267,7 +583,7 @@ func (x *RunScriptRequest) String() string {
|
||||
func (*RunScriptRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RunScriptRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[4]
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[11]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -280,7 +596,7 @@ func (x *RunScriptRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RunScriptRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RunScriptRequest) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{4}
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *RunScriptRequest) GetName() string {
|
||||
@@ -306,7 +622,7 @@ type RunScriptResponse struct {
|
||||
|
||||
func (x *RunScriptResponse) Reset() {
|
||||
*x = RunScriptResponse{}
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[5]
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -318,7 +634,7 @@ func (x *RunScriptResponse) String() string {
|
||||
func (*RunScriptResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RunScriptResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[5]
|
||||
mi := &file_homelab_v1_homelab_proto_msgTypes[12]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -331,7 +647,7 @@ func (x *RunScriptResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RunScriptResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RunScriptResponse) Descriptor() ([]byte, []int) {
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{5}
|
||||
return file_homelab_v1_homelab_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *RunScriptResponse) GetOutput() string {
|
||||
@@ -346,28 +662,46 @@ var File_homelab_v1_homelab_proto protoreflect.FileDescriptor
|
||||
const file_homelab_v1_homelab_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x18homelab/v1/homelab.proto\x12\n" +
|
||||
"homelab.v1\"\x89\x01\n" +
|
||||
"homelab.v1\"u\n" +
|
||||
"\x04Item\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" +
|
||||
"\x04type\x18\x02 \x01(\tR\x04type\x12\x12\n" +
|
||||
"\x04data\x18\x03 \x01(\tR\x04data\x12\x14\n" +
|
||||
"\x05value\x18\x04 \x01(\tR\x05value\x12\x12\n" +
|
||||
"\x04args\x18\x05 \x01(\x05R\x04args\x12\x1b\n" +
|
||||
"\targ_types\x18\x06 \x03(\tR\bargTypes\"Y\n" +
|
||||
"\aSection\x12\x12\n" +
|
||||
"\x04data\x18\x02 \x01(\tR\x04data\x12\x14\n" +
|
||||
"\x05value\x18\x03 \x01(\tR\x05value\x12\x12\n" +
|
||||
"\x04args\x18\x04 \x01(\x05R\x04args\x12\x1b\n" +
|
||||
"\targ_types\x18\x05 \x03(\tR\bargTypes\",\n" +
|
||||
"\x04Link\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" +
|
||||
"\x03url\x18\x02 \x01(\tR\x03url\"\x14\n" +
|
||||
"\x12ListContentRequest\"\x91\x01\n" +
|
||||
"\x13ListContentResponse\x12&\n" +
|
||||
"\x05links\x18\x01 \x03(\v2\x10.homelab.v1.LinkR\x05links\x12,\n" +
|
||||
"\bmonitors\x18\x02 \x03(\v2\x10.homelab.v1.ItemR\bmonitors\x12$\n" +
|
||||
"\x04exec\x18\x03 \x03(\v2\x10.homelab.v1.ItemR\x04exec\"1\n" +
|
||||
"\aDocMeta\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" +
|
||||
"\x04icon\x18\x02 \x01(\tR\x04icon\x12&\n" +
|
||||
"\x05items\x18\x03 \x03(\v2\x10.homelab.v1.ItemR\x05items\"\x15\n" +
|
||||
"\x13ListSectionsRequest\"G\n" +
|
||||
"\x14ListSectionsResponse\x12/\n" +
|
||||
"\bsections\x18\x01 \x03(\v2\x13.homelab.v1.SectionR\bsections\":\n" +
|
||||
"\x04hash\x18\x02 \x01(\tR\x04hash\"\x11\n" +
|
||||
"\x0fListDocsRequest\";\n" +
|
||||
"\x10ListDocsResponse\x12'\n" +
|
||||
"\x04docs\x18\x01 \x03(\v2\x13.homelab.v1.DocMetaR\x04docs\"#\n" +
|
||||
"\rGetDocRequest\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\"*\n" +
|
||||
"\x0eGetDocResponse\x12\x18\n" +
|
||||
"\acontent\x18\x01 \x01(\tR\acontent\">\n" +
|
||||
"\x0eSaveDocRequest\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\"%\n" +
|
||||
"\x0fSaveDocResponse\x12\x12\n" +
|
||||
"\x04hash\x18\x01 \x01(\tR\x04hash\":\n" +
|
||||
"\x10RunScriptRequest\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" +
|
||||
"\x04args\x18\x02 \x03(\tR\x04args\"+\n" +
|
||||
"\x11RunScriptResponse\x12\x16\n" +
|
||||
"\x06output\x18\x01 \x01(\tR\x06output2\xad\x01\n" +
|
||||
"\x0eHomelabService\x12Q\n" +
|
||||
"\fListSections\x12\x1f.homelab.v1.ListSectionsRequest\x1a .homelab.v1.ListSectionsResponse\x12H\n" +
|
||||
"\x06output\x18\x01 \x01(\tR\x06output2\xf6\x02\n" +
|
||||
"\x0eHomelabService\x12N\n" +
|
||||
"\vListContent\x12\x1e.homelab.v1.ListContentRequest\x1a\x1f.homelab.v1.ListContentResponse\x12E\n" +
|
||||
"\bListDocs\x12\x1b.homelab.v1.ListDocsRequest\x1a\x1c.homelab.v1.ListDocsResponse\x12?\n" +
|
||||
"\x06GetDoc\x12\x19.homelab.v1.GetDocRequest\x1a\x1a.homelab.v1.GetDocResponse\x12B\n" +
|
||||
"\aSaveDoc\x12\x1a.homelab.v1.SaveDocRequest\x1a\x1b.homelab.v1.SaveDocResponse\x12H\n" +
|
||||
"\tRunScript\x12\x1c.homelab.v1.RunScriptRequest\x1a\x1d.homelab.v1.RunScriptResponseB*Z(pwa-homelab-mon/gen/homelab/v1;homelabv1b\x06proto3"
|
||||
|
||||
var (
|
||||
@@ -382,27 +716,42 @@ func file_homelab_v1_homelab_proto_rawDescGZIP() []byte {
|
||||
return file_homelab_v1_homelab_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_homelab_v1_homelab_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_homelab_v1_homelab_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||
var file_homelab_v1_homelab_proto_goTypes = []any{
|
||||
(*Item)(nil), // 0: homelab.v1.Item
|
||||
(*Section)(nil), // 1: homelab.v1.Section
|
||||
(*ListSectionsRequest)(nil), // 2: homelab.v1.ListSectionsRequest
|
||||
(*ListSectionsResponse)(nil), // 3: homelab.v1.ListSectionsResponse
|
||||
(*RunScriptRequest)(nil), // 4: homelab.v1.RunScriptRequest
|
||||
(*RunScriptResponse)(nil), // 5: homelab.v1.RunScriptResponse
|
||||
(*Item)(nil), // 0: homelab.v1.Item
|
||||
(*Link)(nil), // 1: homelab.v1.Link
|
||||
(*ListContentRequest)(nil), // 2: homelab.v1.ListContentRequest
|
||||
(*ListContentResponse)(nil), // 3: homelab.v1.ListContentResponse
|
||||
(*DocMeta)(nil), // 4: homelab.v1.DocMeta
|
||||
(*ListDocsRequest)(nil), // 5: homelab.v1.ListDocsRequest
|
||||
(*ListDocsResponse)(nil), // 6: homelab.v1.ListDocsResponse
|
||||
(*GetDocRequest)(nil), // 7: homelab.v1.GetDocRequest
|
||||
(*GetDocResponse)(nil), // 8: homelab.v1.GetDocResponse
|
||||
(*SaveDocRequest)(nil), // 9: homelab.v1.SaveDocRequest
|
||||
(*SaveDocResponse)(nil), // 10: homelab.v1.SaveDocResponse
|
||||
(*RunScriptRequest)(nil), // 11: homelab.v1.RunScriptRequest
|
||||
(*RunScriptResponse)(nil), // 12: homelab.v1.RunScriptResponse
|
||||
}
|
||||
var file_homelab_v1_homelab_proto_depIdxs = []int32{
|
||||
0, // 0: homelab.v1.Section.items:type_name -> homelab.v1.Item
|
||||
1, // 1: homelab.v1.ListSectionsResponse.sections:type_name -> homelab.v1.Section
|
||||
2, // 2: homelab.v1.HomelabService.ListSections:input_type -> homelab.v1.ListSectionsRequest
|
||||
4, // 3: homelab.v1.HomelabService.RunScript:input_type -> homelab.v1.RunScriptRequest
|
||||
3, // 4: homelab.v1.HomelabService.ListSections:output_type -> homelab.v1.ListSectionsResponse
|
||||
5, // 5: homelab.v1.HomelabService.RunScript:output_type -> homelab.v1.RunScriptResponse
|
||||
4, // [4:6] is the sub-list for method output_type
|
||||
2, // [2:4] 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
|
||||
1, // 0: homelab.v1.ListContentResponse.links:type_name -> homelab.v1.Link
|
||||
0, // 1: homelab.v1.ListContentResponse.monitors:type_name -> homelab.v1.Item
|
||||
0, // 2: homelab.v1.ListContentResponse.exec:type_name -> homelab.v1.Item
|
||||
4, // 3: homelab.v1.ListDocsResponse.docs:type_name -> homelab.v1.DocMeta
|
||||
2, // 4: homelab.v1.HomelabService.ListContent:input_type -> homelab.v1.ListContentRequest
|
||||
5, // 5: homelab.v1.HomelabService.ListDocs:input_type -> homelab.v1.ListDocsRequest
|
||||
7, // 6: homelab.v1.HomelabService.GetDoc:input_type -> homelab.v1.GetDocRequest
|
||||
9, // 7: homelab.v1.HomelabService.SaveDoc:input_type -> homelab.v1.SaveDocRequest
|
||||
11, // 8: homelab.v1.HomelabService.RunScript:input_type -> homelab.v1.RunScriptRequest
|
||||
3, // 9: homelab.v1.HomelabService.ListContent:output_type -> homelab.v1.ListContentResponse
|
||||
6, // 10: homelab.v1.HomelabService.ListDocs:output_type -> homelab.v1.ListDocsResponse
|
||||
8, // 11: homelab.v1.HomelabService.GetDoc:output_type -> homelab.v1.GetDocResponse
|
||||
10, // 12: homelab.v1.HomelabService.SaveDoc:output_type -> homelab.v1.SaveDocResponse
|
||||
12, // 13: homelab.v1.HomelabService.RunScript:output_type -> homelab.v1.RunScriptResponse
|
||||
9, // [9:14] is the sub-list for method output_type
|
||||
4, // [4:9] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_homelab_v1_homelab_proto_init() }
|
||||
@@ -416,7 +765,7 @@ func file_homelab_v1_homelab_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_homelab_v1_homelab_proto_rawDesc), len(file_homelab_v1_homelab_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 6,
|
||||
NumMessages: 13,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -33,9 +33,15 @@ const (
|
||||
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||
// period.
|
||||
const (
|
||||
// HomelabServiceListSectionsProcedure is the fully-qualified name of the HomelabService's
|
||||
// ListSections RPC.
|
||||
HomelabServiceListSectionsProcedure = "/homelab.v1.HomelabService/ListSections"
|
||||
// HomelabServiceListContentProcedure is the fully-qualified name of the HomelabService's
|
||||
// ListContent RPC.
|
||||
HomelabServiceListContentProcedure = "/homelab.v1.HomelabService/ListContent"
|
||||
// HomelabServiceListDocsProcedure is the fully-qualified name of the HomelabService's ListDocs RPC.
|
||||
HomelabServiceListDocsProcedure = "/homelab.v1.HomelabService/ListDocs"
|
||||
// HomelabServiceGetDocProcedure is the fully-qualified name of the HomelabService's GetDoc RPC.
|
||||
HomelabServiceGetDocProcedure = "/homelab.v1.HomelabService/GetDoc"
|
||||
// HomelabServiceSaveDocProcedure is the fully-qualified name of the HomelabService's SaveDoc RPC.
|
||||
HomelabServiceSaveDocProcedure = "/homelab.v1.HomelabService/SaveDoc"
|
||||
// HomelabServiceRunScriptProcedure is the fully-qualified name of the HomelabService's RunScript
|
||||
// RPC.
|
||||
HomelabServiceRunScriptProcedure = "/homelab.v1.HomelabService/RunScript"
|
||||
@@ -43,7 +49,10 @@ const (
|
||||
|
||||
// HomelabServiceClient is a client for the homelab.v1.HomelabService service.
|
||||
type HomelabServiceClient interface {
|
||||
ListSections(context.Context, *connect.Request[v1.ListSectionsRequest]) (*connect.Response[v1.ListSectionsResponse], error)
|
||||
ListContent(context.Context, *connect.Request[v1.ListContentRequest]) (*connect.Response[v1.ListContentResponse], error)
|
||||
ListDocs(context.Context, *connect.Request[v1.ListDocsRequest]) (*connect.Response[v1.ListDocsResponse], error)
|
||||
GetDoc(context.Context, *connect.Request[v1.GetDocRequest]) (*connect.Response[v1.GetDocResponse], error)
|
||||
SaveDoc(context.Context, *connect.Request[v1.SaveDocRequest]) (*connect.Response[v1.SaveDocResponse], error)
|
||||
RunScript(context.Context, *connect.Request[v1.RunScriptRequest]) (*connect.Response[v1.RunScriptResponse], error)
|
||||
}
|
||||
|
||||
@@ -58,10 +67,28 @@ func NewHomelabServiceClient(httpClient connect.HTTPClient, baseURL string, opts
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
homelabServiceMethods := v1.File_homelab_v1_homelab_proto.Services().ByName("HomelabService").Methods()
|
||||
return &homelabServiceClient{
|
||||
listSections: connect.NewClient[v1.ListSectionsRequest, v1.ListSectionsResponse](
|
||||
listContent: connect.NewClient[v1.ListContentRequest, v1.ListContentResponse](
|
||||
httpClient,
|
||||
baseURL+HomelabServiceListSectionsProcedure,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListSections")),
|
||||
baseURL+HomelabServiceListContentProcedure,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListContent")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listDocs: connect.NewClient[v1.ListDocsRequest, v1.ListDocsResponse](
|
||||
httpClient,
|
||||
baseURL+HomelabServiceListDocsProcedure,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListDocs")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
getDoc: connect.NewClient[v1.GetDocRequest, v1.GetDocResponse](
|
||||
httpClient,
|
||||
baseURL+HomelabServiceGetDocProcedure,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("GetDoc")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
saveDoc: connect.NewClient[v1.SaveDocRequest, v1.SaveDocResponse](
|
||||
httpClient,
|
||||
baseURL+HomelabServiceSaveDocProcedure,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("SaveDoc")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
runScript: connect.NewClient[v1.RunScriptRequest, v1.RunScriptResponse](
|
||||
@@ -75,13 +102,31 @@ func NewHomelabServiceClient(httpClient connect.HTTPClient, baseURL string, opts
|
||||
|
||||
// homelabServiceClient implements HomelabServiceClient.
|
||||
type homelabServiceClient struct {
|
||||
listSections *connect.Client[v1.ListSectionsRequest, v1.ListSectionsResponse]
|
||||
runScript *connect.Client[v1.RunScriptRequest, v1.RunScriptResponse]
|
||||
listContent *connect.Client[v1.ListContentRequest, v1.ListContentResponse]
|
||||
listDocs *connect.Client[v1.ListDocsRequest, v1.ListDocsResponse]
|
||||
getDoc *connect.Client[v1.GetDocRequest, v1.GetDocResponse]
|
||||
saveDoc *connect.Client[v1.SaveDocRequest, v1.SaveDocResponse]
|
||||
runScript *connect.Client[v1.RunScriptRequest, v1.RunScriptResponse]
|
||||
}
|
||||
|
||||
// ListSections calls homelab.v1.HomelabService.ListSections.
|
||||
func (c *homelabServiceClient) ListSections(ctx context.Context, req *connect.Request[v1.ListSectionsRequest]) (*connect.Response[v1.ListSectionsResponse], error) {
|
||||
return c.listSections.CallUnary(ctx, req)
|
||||
// ListContent calls homelab.v1.HomelabService.ListContent.
|
||||
func (c *homelabServiceClient) ListContent(ctx context.Context, req *connect.Request[v1.ListContentRequest]) (*connect.Response[v1.ListContentResponse], error) {
|
||||
return c.listContent.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListDocs calls homelab.v1.HomelabService.ListDocs.
|
||||
func (c *homelabServiceClient) ListDocs(ctx context.Context, req *connect.Request[v1.ListDocsRequest]) (*connect.Response[v1.ListDocsResponse], error) {
|
||||
return c.listDocs.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// GetDoc calls homelab.v1.HomelabService.GetDoc.
|
||||
func (c *homelabServiceClient) GetDoc(ctx context.Context, req *connect.Request[v1.GetDocRequest]) (*connect.Response[v1.GetDocResponse], error) {
|
||||
return c.getDoc.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// SaveDoc calls homelab.v1.HomelabService.SaveDoc.
|
||||
func (c *homelabServiceClient) SaveDoc(ctx context.Context, req *connect.Request[v1.SaveDocRequest]) (*connect.Response[v1.SaveDocResponse], error) {
|
||||
return c.saveDoc.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// RunScript calls homelab.v1.HomelabService.RunScript.
|
||||
@@ -91,7 +136,10 @@ func (c *homelabServiceClient) RunScript(ctx context.Context, req *connect.Reque
|
||||
|
||||
// HomelabServiceHandler is an implementation of the homelab.v1.HomelabService service.
|
||||
type HomelabServiceHandler interface {
|
||||
ListSections(context.Context, *connect.Request[v1.ListSectionsRequest]) (*connect.Response[v1.ListSectionsResponse], error)
|
||||
ListContent(context.Context, *connect.Request[v1.ListContentRequest]) (*connect.Response[v1.ListContentResponse], error)
|
||||
ListDocs(context.Context, *connect.Request[v1.ListDocsRequest]) (*connect.Response[v1.ListDocsResponse], error)
|
||||
GetDoc(context.Context, *connect.Request[v1.GetDocRequest]) (*connect.Response[v1.GetDocResponse], error)
|
||||
SaveDoc(context.Context, *connect.Request[v1.SaveDocRequest]) (*connect.Response[v1.SaveDocResponse], error)
|
||||
RunScript(context.Context, *connect.Request[v1.RunScriptRequest]) (*connect.Response[v1.RunScriptResponse], error)
|
||||
}
|
||||
|
||||
@@ -102,10 +150,28 @@ type HomelabServiceHandler interface {
|
||||
// and JSON codecs. They also support gzip compression.
|
||||
func NewHomelabServiceHandler(svc HomelabServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||
homelabServiceMethods := v1.File_homelab_v1_homelab_proto.Services().ByName("HomelabService").Methods()
|
||||
homelabServiceListSectionsHandler := connect.NewUnaryHandler(
|
||||
HomelabServiceListSectionsProcedure,
|
||||
svc.ListSections,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListSections")),
|
||||
homelabServiceListContentHandler := connect.NewUnaryHandler(
|
||||
HomelabServiceListContentProcedure,
|
||||
svc.ListContent,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListContent")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
homelabServiceListDocsHandler := connect.NewUnaryHandler(
|
||||
HomelabServiceListDocsProcedure,
|
||||
svc.ListDocs,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("ListDocs")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
homelabServiceGetDocHandler := connect.NewUnaryHandler(
|
||||
HomelabServiceGetDocProcedure,
|
||||
svc.GetDoc,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("GetDoc")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
homelabServiceSaveDocHandler := connect.NewUnaryHandler(
|
||||
HomelabServiceSaveDocProcedure,
|
||||
svc.SaveDoc,
|
||||
connect.WithSchema(homelabServiceMethods.ByName("SaveDoc")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
homelabServiceRunScriptHandler := connect.NewUnaryHandler(
|
||||
@@ -116,8 +182,14 @@ func NewHomelabServiceHandler(svc HomelabServiceHandler, opts ...connect.Handler
|
||||
)
|
||||
return "/homelab.v1.HomelabService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case HomelabServiceListSectionsProcedure:
|
||||
homelabServiceListSectionsHandler.ServeHTTP(w, r)
|
||||
case HomelabServiceListContentProcedure:
|
||||
homelabServiceListContentHandler.ServeHTTP(w, r)
|
||||
case HomelabServiceListDocsProcedure:
|
||||
homelabServiceListDocsHandler.ServeHTTP(w, r)
|
||||
case HomelabServiceGetDocProcedure:
|
||||
homelabServiceGetDocHandler.ServeHTTP(w, r)
|
||||
case HomelabServiceSaveDocProcedure:
|
||||
homelabServiceSaveDocHandler.ServeHTTP(w, r)
|
||||
case HomelabServiceRunScriptProcedure:
|
||||
homelabServiceRunScriptHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
@@ -129,8 +201,20 @@ func NewHomelabServiceHandler(svc HomelabServiceHandler, opts ...connect.Handler
|
||||
// UnimplementedHomelabServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedHomelabServiceHandler struct{}
|
||||
|
||||
func (UnimplementedHomelabServiceHandler) ListSections(context.Context, *connect.Request[v1.ListSectionsRequest]) (*connect.Response[v1.ListSectionsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("homelab.v1.HomelabService.ListSections is not implemented"))
|
||||
func (UnimplementedHomelabServiceHandler) ListContent(context.Context, *connect.Request[v1.ListContentRequest]) (*connect.Response[v1.ListContentResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("homelab.v1.HomelabService.ListContent is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedHomelabServiceHandler) ListDocs(context.Context, *connect.Request[v1.ListDocsRequest]) (*connect.Response[v1.ListDocsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("homelab.v1.HomelabService.ListDocs is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedHomelabServiceHandler) GetDoc(context.Context, *connect.Request[v1.GetDocRequest]) (*connect.Response[v1.GetDocResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("homelab.v1.HomelabService.GetDoc is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedHomelabServiceHandler) SaveDoc(context.Context, *connect.Request[v1.SaveDocRequest]) (*connect.Response[v1.SaveDocResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("homelab.v1.HomelabService.SaveDoc is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedHomelabServiceHandler) RunScript(context.Context, *connect.Request[v1.RunScriptRequest]) (*connect.Response[v1.RunScriptResponse], error) {
|
||||
|
||||
Reference in New Issue
Block a user