Some checks failed
Pipeline: Test, Lint, Build / Get version info (push) Has been cancelled
Pipeline: Test, Lint, Build / Lint Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Test Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Test JS code (push) Has been cancelled
Pipeline: Test, Lint, Build / Lint i18n files (push) Has been cancelled
Pipeline: Test, Lint, Build / Check Docker configuration (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (darwin/amd64) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (darwin/arm64) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/386) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/amd64) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/arm/v5) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/arm/v6) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/arm/v7) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (linux/arm64) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (windows/386) (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (windows/amd64) (push) Has been cancelled
Pipeline: Test, Lint, Build / Push to GHCR (push) Has been cancelled
Pipeline: Test, Lint, Build / Push to Docker Hub (push) Has been cancelled
Pipeline: Test, Lint, Build / Cleanup digest artifacts (push) Has been cancelled
Pipeline: Test, Lint, Build / Build Windows installers (push) Has been cancelled
Pipeline: Test, Lint, Build / Package/Release (push) Has been cancelled
Pipeline: Test, Lint, Build / Upload Linux PKG (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
POEditor import / update-translations (push) Has been cancelled
118 lines
3.3 KiB
Go
118 lines
3.3 KiB
Go
// Code generated by protoc-gen-go-plugin. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go-plugin v0.1.0
|
|
// protoc v5.29.3
|
|
// source: host/http/http.proto
|
|
|
|
package http
|
|
|
|
import (
|
|
context "context"
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
)
|
|
|
|
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 HttpRequest struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
|
|
Headers map[string]string `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
TimeoutMs int32 `protobuf:"varint,3,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"`
|
|
Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` // Ignored for GET/DELETE/HEAD/OPTIONS
|
|
}
|
|
|
|
func (x *HttpRequest) ProtoReflect() protoreflect.Message {
|
|
panic(`not implemented`)
|
|
}
|
|
|
|
func (x *HttpRequest) GetUrl() string {
|
|
if x != nil {
|
|
return x.Url
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *HttpRequest) GetHeaders() map[string]string {
|
|
if x != nil {
|
|
return x.Headers
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *HttpRequest) GetTimeoutMs() int32 {
|
|
if x != nil {
|
|
return x.TimeoutMs
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *HttpRequest) GetBody() []byte {
|
|
if x != nil {
|
|
return x.Body
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type HttpResponse struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
|
|
Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
|
|
Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
|
|
Headers map[string]string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // Non-empty if network/protocol error
|
|
}
|
|
|
|
func (x *HttpResponse) ProtoReflect() protoreflect.Message {
|
|
panic(`not implemented`)
|
|
}
|
|
|
|
func (x *HttpResponse) GetStatus() int32 {
|
|
if x != nil {
|
|
return x.Status
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *HttpResponse) GetBody() []byte {
|
|
if x != nil {
|
|
return x.Body
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *HttpResponse) GetHeaders() map[string]string {
|
|
if x != nil {
|
|
return x.Headers
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *HttpResponse) GetError() string {
|
|
if x != nil {
|
|
return x.Error
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// go:plugin type=host version=1
|
|
type HttpService interface {
|
|
Get(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Post(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Put(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Delete(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Patch(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Head(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
Options(context.Context, *HttpRequest) (*HttpResponse, error)
|
|
}
|