aboutsummaryrefslogtreecommitdiff
path: root/pb
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-02-18 13:34:51 -0500
committerXe Iaso <me@xeiaso.net>2024-02-18 13:34:51 -0500
commit8d63fd1b351cf9ffd99555b21017cc503dd1d0fe (patch)
treee642b17c4a445006dc0e92025725ebf430f932b0 /pb
parent5a4d6d92e9d3c1483104f2adcc9085b64bd1871f (diff)
downloadxesite-8d63fd1b351cf9ffd99555b21017cc503dd1d0fe.tar.xz
xesite-8d63fd1b351cf9ffd99555b21017cc503dd1d0fe.zip
add an external API
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'pb')
-rw-r--r--pb/generate.go8
-rw-r--r--pb/openapi.json61
-rw-r--r--pb/xesite.pb.go39
-rw-r--r--pb/xesite.proto2
-rw-r--r--pb/xesite.twirp.go123
5 files changed, 157 insertions, 76 deletions
diff --git a/pb/generate.go b/pb/generate.go
index 5adfc1a..db5295f 100644
--- a/pb/generate.go
+++ b/pb/generate.go
@@ -1,5 +1,13 @@
package pb
+import (
+ "embed"
+)
+
func init() {}
//go:generate protoc --proto_path=. --go_out=. --go_opt=paths=source_relative --twirp_out=. --twirp_opt=paths=source_relative xesite.proto
+//go:generate go run github.com/blockthrough/twirp-openapi-gen/cmd/twirp-openapi-gen --in=xesite.proto --path-prefix=/api --servers=https://xeiaso.net --title="xeiaso.net API" --out openapi.json
+
+//go:embed xesite.proto openapi.json
+var Proto embed.FS
diff --git a/pb/openapi.json b/pb/openapi.json
new file mode 100644
index 0000000..8db285c
--- /dev/null
+++ b/pb/openapi.json
@@ -0,0 +1,61 @@
+{
+ "components": {
+ "schemas": {
+ "xeiaso.net.BuildInfo": {
+ "properties": {
+ "build_time": {
+ "format": "date-time",
+ "type": "string"
+ },
+ "commit": {
+ "type": "string"
+ },
+ "deno_version": {
+ "type": "string"
+ },
+ "go_version": {
+ "type": "string"
+ },
+ "xesite_version": {
+ "type": "string"
+ }
+ },
+ "type": "object"
+ }
+ }
+ },
+ "info": {
+ "title": "xeiaso.net API",
+ "version": "0.1"
+ },
+ "openapi": "3.0.0",
+ "paths": {
+ "/api/xeiaso.net.Meta/Metadata": {
+ "post": {
+ "requestBody": {
+ "content": {
+ "application/json": {}
+ }
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/xeiaso.net.BuildInfo"
+ }
+ }
+ },
+ "description": "Success"
+ }
+ },
+ "summary": "Metadata"
+ }
+ }
+ },
+ "servers": [
+ {
+ "url": "https://xeiaso.net"
+ }
+ ]
+} \ No newline at end of file
diff --git a/pb/xesite.pb.go b/pb/xesite.pb.go
index 1691ffd..0073d07 100644
--- a/pb/xesite.pb.go
+++ b/pb/xesite.pb.go
@@ -27,10 +27,11 @@ type BuildInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Commit string `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
- BuildTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=build_time,json=buildTime,proto3" json:"build_time,omitempty"`
- GoVersion string `protobuf:"bytes,3,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"`
- DenoVersion string `protobuf:"bytes,4,opt,name=deno_version,json=denoVersion,proto3" json:"deno_version,omitempty"`
+ Commit string `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
+ BuildTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=build_time,json=buildTime,proto3" json:"build_time,omitempty"`
+ GoVersion string `protobuf:"bytes,3,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"`
+ DenoVersion string `protobuf:"bytes,4,opt,name=deno_version,json=denoVersion,proto3" json:"deno_version,omitempty"`
+ XesiteVersion string `protobuf:"bytes,5,opt,name=xesite_version,json=xesiteVersion,proto3" json:"xesite_version,omitempty"`
}
func (x *BuildInfo) Reset() {
@@ -93,6 +94,13 @@ func (x *BuildInfo) GetDenoVersion() string {
return ""
}
+func (x *BuildInfo) GetXesiteVersion() string {
+ if x != nil {
+ return x.XesiteVersion
+ }
+ return ""
+}
+
var File_xesite_proto protoreflect.FileDescriptor
var file_xesite_proto_rawDesc = []byte{
@@ -101,7 +109,7 @@ var file_xesite_proto_rawDesc = []byte{
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,
0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69,
+ 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x01, 0x0a, 0x09, 0x42, 0x75, 0x69,
0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x39,
0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
@@ -111,13 +119,16 @@ var file_xesite_proto_rawDesc = []byte{
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67,
0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x6e, 0x6f,
0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
- 0x64, 0x65, 0x6e, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x41, 0x0a, 0x04, 0x4c,
- 0x75, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,
- 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x78, 0x65, 0x69, 0x61, 0x73, 0x6f,
- 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x12,
- 0x5a, 0x10, 0x78, 0x65, 0x69, 0x61, 0x73, 0x6f, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x76, 0x34, 0x2f,
- 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x64, 0x65, 0x6e, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x78,
+ 0x65, 0x73, 0x69, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0d, 0x78, 0x65, 0x73, 0x69, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x32, 0x41, 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x08, 0x4d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x15,
+ 0x2e, 0x78, 0x65, 0x69, 0x61, 0x73, 0x6f, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x42, 0x75, 0x69, 0x6c,
+ 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x12, 0x5a, 0x10, 0x78, 0x65, 0x69, 0x61, 0x73, 0x6f, 0x2e,
+ 0x6e, 0x65, 0x74, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x33,
}
var (
@@ -140,8 +151,8 @@ var file_xesite_proto_goTypes = []interface{}{
}
var file_xesite_proto_depIdxs = []int32{
1, // 0: xeiaso.net.BuildInfo.build_time:type_name -> google.protobuf.Timestamp
- 2, // 1: xeiaso.net.Lume.Metadata:input_type -> google.protobuf.Empty
- 0, // 2: xeiaso.net.Lume.Metadata:output_type -> xeiaso.net.BuildInfo
+ 2, // 1: xeiaso.net.Meta.Metadata:input_type -> google.protobuf.Empty
+ 0, // 2: xeiaso.net.Meta.Metadata:output_type -> xeiaso.net.BuildInfo
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
diff --git a/pb/xesite.proto b/pb/xesite.proto
index 9dbaabf..8644aa1 100644
--- a/pb/xesite.proto
+++ b/pb/xesite.proto
@@ -5,7 +5,7 @@ option go_package = "xeiaso.net/v4/pb";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
-service Lume { rpc Metadata(google.protobuf.Empty) returns (BuildInfo); }
+service Meta { rpc Metadata(google.protobuf.Empty) returns (BuildInfo); }
message BuildInfo {
string commit = 1;
diff --git a/pb/xesite.twirp.go b/pb/xesite.twirp.go
index a1b59be..8548b7f 100644
--- a/pb/xesite.twirp.go
+++ b/pb/xesite.twirp.go
@@ -30,27 +30,27 @@ import url "net/url"
const _ = twirp.TwirpPackageMinVersion_8_1_0
// ==============
-// Lume Interface
+// Meta Interface
// ==============
-type Lume interface {
+type Meta interface {
Metadata(context.Context, *google_protobuf.Empty) (*BuildInfo, error)
}
// ====================
-// Lume Protobuf Client
+// Meta Protobuf Client
// ====================
-type lumeProtobufClient struct {
+type metaProtobufClient struct {
client HTTPClient
urls [1]string
interceptor twirp.Interceptor
opts twirp.ClientOptions
}
-// NewLumeProtobufClient creates a Protobuf client that implements the Lume interface.
+// NewMetaProtobufClient creates a Protobuf client that implements the Meta interface.
// It communicates using Protobuf and can be configured with a custom HTTPClient.
-func NewLumeProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Lume {
+func NewMetaProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Meta {
if c, ok := client.(*http.Client); ok {
client = withoutRedirects(c)
}
@@ -70,12 +70,12 @@ func NewLumeProtobufClient(baseURL string, client HTTPClient, opts ...twirp.Clie
// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
serviceURL := sanitizeBaseURL(baseURL)
- serviceURL += baseServicePath(pathPrefix, "xeiaso.net", "Lume")
+ serviceURL += baseServicePath(pathPrefix, "xeiaso.net", "Meta")
urls := [1]string{
serviceURL + "Metadata",
}
- return &lumeProtobufClient{
+ return &metaProtobufClient{
client: client,
urls: urls,
interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...),
@@ -83,9 +83,9 @@ func NewLumeProtobufClient(baseURL string, client HTTPClient, opts ...twirp.Clie
}
}
-func (c *lumeProtobufClient) Metadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
+func (c *metaProtobufClient) Metadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "xeiaso.net")
- ctx = ctxsetters.WithServiceName(ctx, "Lume")
+ ctx = ctxsetters.WithServiceName(ctx, "Meta")
ctx = ctxsetters.WithMethodName(ctx, "Metadata")
caller := c.callMetadata
if c.interceptor != nil {
@@ -112,7 +112,7 @@ func (c *lumeProtobufClient) Metadata(ctx context.Context, in *google_protobuf.E
return caller(ctx, in)
}
-func (c *lumeProtobufClient) callMetadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
+func (c *metaProtobufClient) callMetadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
out := new(BuildInfo)
ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
if err != nil {
@@ -130,19 +130,19 @@ func (c *lumeProtobufClient) callMetadata(ctx context.Context, in *google_protob
}
// ================
-// Lume JSON Client
+// Meta JSON Client
// ================
-type lumeJSONClient struct {
+type metaJSONClient struct {
client HTTPClient
urls [1]string
interceptor twirp.Interceptor
opts twirp.ClientOptions
}
-// NewLumeJSONClient creates a JSON client that implements the Lume interface.
+// NewMetaJSONClient creates a JSON client that implements the Meta interface.
// It communicates using JSON and can be configured with a custom HTTPClient.
-func NewLumeJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Lume {
+func NewMetaJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Meta {
if c, ok := client.(*http.Client); ok {
client = withoutRedirects(c)
}
@@ -162,12 +162,12 @@ func NewLumeJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOp
// Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method>
serviceURL := sanitizeBaseURL(baseURL)
- serviceURL += baseServicePath(pathPrefix, "xeiaso.net", "Lume")
+ serviceURL += baseServicePath(pathPrefix, "xeiaso.net", "Meta")
urls := [1]string{
serviceURL + "Metadata",
}
- return &lumeJSONClient{
+ return &metaJSONClient{
client: client,
urls: urls,
interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...),
@@ -175,9 +175,9 @@ func NewLumeJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOp
}
}
-func (c *lumeJSONClient) Metadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
+func (c *metaJSONClient) Metadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
ctx = ctxsetters.WithPackageName(ctx, "xeiaso.net")
- ctx = ctxsetters.WithServiceName(ctx, "Lume")
+ ctx = ctxsetters.WithServiceName(ctx, "Meta")
ctx = ctxsetters.WithMethodName(ctx, "Metadata")
caller := c.callMetadata
if c.interceptor != nil {
@@ -204,7 +204,7 @@ func (c *lumeJSONClient) Metadata(ctx context.Context, in *google_protobuf.Empty
return caller(ctx, in)
}
-func (c *lumeJSONClient) callMetadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
+func (c *metaJSONClient) callMetadata(ctx context.Context, in *google_protobuf.Empty) (*BuildInfo, error) {
out := new(BuildInfo)
ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out)
if err != nil {
@@ -222,11 +222,11 @@ func (c *lumeJSONClient) callMetadata(ctx context.Context, in *google_protobuf.E
}
// ===================
-// Lume Server Handler
+// Meta Server Handler
// ===================
-type lumeServer struct {
- Lume
+type metaServer struct {
+ Meta
interceptor twirp.Interceptor
hooks *twirp.ServerHooks
pathPrefix string // prefix for routing
@@ -234,10 +234,10 @@ type lumeServer struct {
jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names
}
-// NewLumeServer builds a TwirpServer that can be used as an http.Handler to handle
+// NewMetaServer builds a TwirpServer that can be used as an http.Handler to handle
// HTTP requests that are routed to the right method in the provided svc implementation.
// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).
-func NewLumeServer(svc Lume, opts ...interface{}) TwirpServer {
+func NewMetaServer(svc Meta, opts ...interface{}) TwirpServer {
serverOpts := newServerOpts(opts)
// Using ReadOpt allows backwards and forwards compatibility with new options in the future
@@ -250,8 +250,8 @@ func NewLumeServer(svc Lume, opts ...interface{}) TwirpServer {
pathPrefix = "/twirp" // default prefix
}
- return &lumeServer{
- Lume: svc,
+ return &metaServer{
+ Meta: svc,
hooks: serverOpts.Hooks,
interceptor: twirp.ChainInterceptors(serverOpts.Interceptors...),
pathPrefix: pathPrefix,
@@ -262,12 +262,12 @@ func NewLumeServer(svc Lume, opts ...interface{}) TwirpServer {
// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks.
// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
-func (s *lumeServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) {
+func (s *metaServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) {
writeError(ctx, resp, err, s.hooks)
}
// handleRequestBodyError is used to handle error when the twirp server cannot read request
-func (s *lumeServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) {
+func (s *metaServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) {
if context.Canceled == ctx.Err() {
s.writeError(ctx, resp, twirp.NewError(twirp.Canceled, "failed to read request: context canceled"))
return
@@ -279,16 +279,16 @@ func (s *lumeServer) handleRequestBodyError(ctx context.Context, resp http.Respo
s.writeError(ctx, resp, twirp.WrapError(malformedRequestError(msg), err))
}
-// LumePathPrefix is a convenience constant that may identify URL paths.
+// MetaPathPrefix is a convenience constant that may identify URL paths.
// Should be used with caution, it only matches routes generated by Twirp Go clients,
// with the default "/twirp" prefix and default CamelCase service and method names.
// More info: https://twitchtv.github.io/twirp/docs/routing.html
-const LumePathPrefix = "/twirp/xeiaso.net.Lume/"
+const MetaPathPrefix = "/twirp/xeiaso.net.Meta/"
-func (s *lumeServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
+func (s *metaServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
ctx := req.Context()
ctx = ctxsetters.WithPackageName(ctx, "xeiaso.net")
- ctx = ctxsetters.WithServiceName(ctx, "Lume")
+ ctx = ctxsetters.WithServiceName(ctx, "Meta")
ctx = ctxsetters.WithResponseWriter(ctx, resp)
var err error
@@ -306,7 +306,7 @@ func (s *lumeServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
// Verify path format: [<prefix>]/<package>.<Service>/<Method>
prefix, pkgService, method := parseTwirpPath(req.URL.Path)
- if pkgService != "xeiaso.net.Lume" {
+ if pkgService != "xeiaso.net.Meta" {
msg := fmt.Sprintf("no handler for path %q", req.URL.Path)
s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path))
return
@@ -328,7 +328,7 @@ func (s *lumeServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
}
}
-func (s *lumeServer) serveMetadata(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
+func (s *metaServer) serveMetadata(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
header := req.Header.Get("Content-Type")
i := strings.Index(header, ";")
if i == -1 {
@@ -346,7 +346,7 @@ func (s *lumeServer) serveMetadata(ctx context.Context, resp http.ResponseWriter
}
}
-func (s *lumeServer) serveMetadataJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
+func (s *metaServer) serveMetadataJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error
ctx = ctxsetters.WithMethodName(ctx, "Metadata")
ctx, err = callRequestRouted(ctx, s.hooks)
@@ -368,7 +368,7 @@ func (s *lumeServer) serveMetadataJSON(ctx context.Context, resp http.ResponseWr
return
}
- handler := s.Lume.Metadata
+ handler := s.Meta.Metadata
if s.interceptor != nil {
handler = func(ctx context.Context, req *google_protobuf.Empty) (*BuildInfo, error) {
resp, err := s.interceptor(
@@ -377,7 +377,7 @@ func (s *lumeServer) serveMetadataJSON(ctx context.Context, resp http.ResponseWr
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*google_protobuf.Empty) when calling interceptor")
}
- return s.Lume.Metadata(ctx, typedReq)
+ return s.Meta.Metadata(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
@@ -429,7 +429,7 @@ func (s *lumeServer) serveMetadataJSON(ctx context.Context, resp http.ResponseWr
callResponseSent(ctx, s.hooks)
}
-func (s *lumeServer) serveMetadataProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
+func (s *metaServer) serveMetadataProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) {
var err error
ctx = ctxsetters.WithMethodName(ctx, "Metadata")
ctx, err = callRequestRouted(ctx, s.hooks)
@@ -449,7 +449,7 @@ func (s *lumeServer) serveMetadataProtobuf(ctx context.Context, resp http.Respon
return
}
- handler := s.Lume.Metadata
+ handler := s.Meta.Metadata
if s.interceptor != nil {
handler = func(ctx context.Context, req *google_protobuf.Empty) (*BuildInfo, error) {
resp, err := s.interceptor(
@@ -458,7 +458,7 @@ func (s *lumeServer) serveMetadataProtobuf(ctx context.Context, resp http.Respon
if !ok {
return nil, twirp.InternalError("failed type assertion req.(*google_protobuf.Empty) when calling interceptor")
}
- return s.Lume.Metadata(ctx, typedReq)
+ return s.Meta.Metadata(ctx, typedReq)
},
)(ctx, req)
if resp != nil {
@@ -508,19 +508,19 @@ func (s *lumeServer) serveMetadataProtobuf(ctx context.Context, resp http.Respon
callResponseSent(ctx, s.hooks)
}
-func (s *lumeServer) ServiceDescriptor() ([]byte, int) {
+func (s *metaServer) ServiceDescriptor() ([]byte, int) {
return twirpFileDescriptor0, 0
}
-func (s *lumeServer) ProtocGenTwirpVersion() string {
+func (s *metaServer) ProtocGenTwirpVersion() string {
return "v8.1.3"
}
// PathPrefix returns the base service path, in the form: "/<prefix>/<package>.<Service>/"
// that is everything in a Twirp route except for the <Method>. This can be used for routing,
// for example to identify the requests that are targeted to this service in a mux.
-func (s *lumeServer) PathPrefix() string {
- return baseServicePath(s.pathPrefix, "xeiaso.net", "Lume")
+func (s *metaServer) PathPrefix() string {
+ return baseServicePath(s.pathPrefix, "xeiaso.net", "Meta")
}
// =====
@@ -1089,21 +1089,22 @@ func callClientError(ctx context.Context, h *twirp.ClientHooks, err twirp.Error)
}
var twirpFileDescriptor0 = []byte{
- // 246 bytes of a gzipped FileDescriptorProto
+ // 258 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xc1, 0x4a, 0xc3, 0x40,
- 0x10, 0x86, 0x89, 0x96, 0x62, 0xa6, 0x3d, 0xc8, 0x80, 0x25, 0x44, 0xc4, 0xea, 0xa9, 0xa7, 0x0d,
- 0x54, 0x2f, 0x3d, 0x5a, 0xf0, 0x20, 0xe8, 0xa5, 0x88, 0x07, 0x2f, 0x65, 0x63, 0xa6, 0x61, 0xa1,
- 0x9b, 0x09, 0xcd, 0xa4, 0xd4, 0xb7, 0xf1, 0x51, 0x65, 0x77, 0x1b, 0x03, 0xf6, 0x38, 0xff, 0x7c,
- 0xf3, 0x2d, 0xff, 0xc2, 0xf8, 0x40, 0x8d, 0x11, 0x52, 0xf5, 0x8e, 0x85, 0x11, 0x0e, 0x64, 0x74,
- 0xc3, 0xaa, 0x22, 0x49, 0xaf, 0x4b, 0xe6, 0x72, 0x4b, 0x99, 0xdf, 0xe4, 0xed, 0x26, 0x23, 0x5b,
- 0xcb, 0x77, 0x00, 0xd3, 0xdb, 0xff, 0x4b, 0x31, 0x96, 0x1a, 0xd1, 0xb6, 0x0e, 0xc0, 0xfd, 0x4f,
- 0x04, 0xf1, 0xb2, 0x35, 0xdb, 0xe2, 0xa5, 0xda, 0x30, 0x4e, 0x60, 0xf8, 0xc5, 0xd6, 0x1a, 0x49,
- 0xa2, 0x69, 0x34, 0x8b, 0x57, 0xc7, 0x09, 0x17, 0x00, 0xb9, 0x83, 0xd6, 0xee, 0x3c, 0x39, 0x9b,
- 0x46, 0xb3, 0xd1, 0x3c, 0x55, 0xc1, 0xad, 0x3a, 0xb7, 0x7a, 0xef, 0xdc, 0xab, 0xd8, 0xd3, 0x6e,
- 0xc6, 0x1b, 0x80, 0x92, 0xd7, 0x7b, 0xda, 0x35, 0x86, 0xab, 0xe4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