Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from pcdummy/main
Browse files Browse the repository at this point in the history
Add v4/transport/grpc plugin, go get -u ./...
  • Loading branch information
xpunch authored Sep 8, 2022
2 parents fa30b10 + a5fb5e2 commit 21a33b3
Show file tree
Hide file tree
Showing 8 changed files with 655 additions and 689 deletions.
78 changes: 64 additions & 14 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag

package docs

import "github.com/swaggo/swag"
import (
"bytes"
"encoding/json"
"strings"

"github.com/alecthomas/template"
"github.com/swaggo/swag"
)

const docTemplate = `{
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"description": "{{.Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
"license": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
Expand Down Expand Up @@ -589,6 +598,9 @@ const docTemplate = `{
"endpoint": {
"type": "string"
},
"metadata": {
"type": "string"
},
"request": {
"type": "string"
},
Expand Down Expand Up @@ -635,6 +647,9 @@ const docTemplate = `{
"message": {
"type": "string"
},
"metadata": {
"type": "string"
},
"topic": {
"type": "string"
}
Expand Down Expand Up @@ -715,9 +730,11 @@ const docTemplate = `{
"type": "string"
},
"request": {
"type": "object",
"$ref": "#/definitions/registry.registryValue"
},
"response": {
"type": "object",
"$ref": "#/definitions/registry.registryValue"
},
"stream": {
Expand Down Expand Up @@ -866,9 +883,11 @@ const docTemplate = `{
"type": "object",
"properties": {
"registry": {
"type": "object",
"$ref": "#/definitions/statistics.registrySummary"
},
"services": {
"type": "object",
"$ref": "#/definitions/statistics.servicesSummary"
}
}
Expand Down Expand Up @@ -908,18 +927,49 @@ const docTemplate = `{
}
}`

type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.4.0",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "Go Micro Dashboard",
Description: "go micro dashboard restful-api",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
var SwaggerInfo = swaggerInfo{
Version: "1.4.0",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "Go Micro Dashboard",
Description: "go micro dashboard restful-api",
}

type s struct{}

func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)

t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}).Parse(doc)
if err != nil {
return doc
}

var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}

return tpl.String()
}

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
swag.Register(swag.Name, &s{})
}
11 changes: 11 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"title": "Go Micro Dashboard",
"termsOfService": "http://swagger.io/terms/",
"contact": {},
"license": {},
"version": "1.4.0"
},
"basePath": "/",
Expand Down Expand Up @@ -581,6 +582,9 @@
"endpoint": {
"type": "string"
},
"metadata": {
"type": "string"
},
"request": {
"type": "string"
},
Expand Down Expand Up @@ -627,6 +631,9 @@
"message": {
"type": "string"
},
"metadata": {
"type": "string"
},
"topic": {
"type": "string"
}
Expand Down Expand Up @@ -707,9 +714,11 @@
"type": "string"
},
"request": {
"type": "object",
"$ref": "#/definitions/registry.registryValue"
},
"response": {
"type": "object",
"$ref": "#/definitions/registry.registryValue"
},
"stream": {
Expand Down Expand Up @@ -858,9 +867,11 @@
"type": "object",
"properties": {
"registry": {
"type": "object",
"$ref": "#/definitions/statistics.registrySummary"
},
"services": {
"type": "object",
"$ref": "#/definitions/statistics.servicesSummary"
}
}
Expand Down
9 changes: 9 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ definitions:
properties:
endpoint:
type: string
metadata:
type: string
request:
type: string
service:
Expand Down Expand Up @@ -57,6 +59,8 @@ definitions:
properties:
message:
type: string
metadata:
type: string
topic:
type: string
required:
Expand Down Expand Up @@ -110,8 +114,10 @@ definitions:
type: string
request:
$ref: '#/definitions/registry.registryValue'
type: object
response:
$ref: '#/definitions/registry.registryValue'
type: object
stream:
type: boolean
required:
Expand Down Expand Up @@ -213,8 +219,10 @@ definitions:
properties:
registry:
$ref: '#/definitions/statistics.registrySummary'
type: object
services:
$ref: '#/definitions/statistics.servicesSummary'
type: object
type: object
statistics.registrySummary:
properties:
Expand All @@ -235,6 +243,7 @@ definitions:
info:
contact: {}
description: go micro dashboard restful-api
license: {}
termsOfService: http://swagger.io/terms/
title: Go Micro Dashboard
version: 1.4.0
Expand Down
3 changes: 3 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
Expand Down
Loading

0 comments on commit 21a33b3

Please sign in to comment.