cmd: update cmd version (#1040)

* update cmd version

* update app info
pull/1044/head
Tony Chen 4 years ago committed by GitHub
parent 2729caeecf
commit 99719dd667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app.go
  2. 2
      cmd/kratos/main.go
  3. 3
      cmd/protoc-gen-go-errors/main.go
  4. 2
      cmd/protoc-gen-go-http/http.go
  5. 2
      cmd/protoc-gen-go-http/main.go
  6. 6
      cmd/protoc-gen-go-http/version.go
  7. 12
      context.go

@ -59,9 +59,11 @@ func (a *App) Run() error {
return err return err
} }
ctx := NewContext(a.ctx, AppInfo{ ctx := NewContext(a.ctx, AppInfo{
ID: a.opts.id, ID: instance.ID,
Name: a.opts.name, Name: instance.Name,
Version: a.opts.version, Version: instance.Version,
Metadata: instance.Metadata,
Endpoints: instance.Endpoints,
}) })
eg, ctx := errgroup.WithContext(ctx) eg, ctx := errgroup.WithContext(ctx)
wg := sync.WaitGroup{} wg := sync.WaitGroup{}

@ -11,7 +11,7 @@ import (
) )
var ( var (
version string = "v2.0.0-rc1" version string = "v2.0.0-rc3"
rootCmd = &cobra.Command{ rootCmd = &cobra.Command{
Use: "kratos", Use: "kratos",

@ -3,11 +3,12 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb" "google.golang.org/protobuf/types/pluginpb"
) )
const version = "v2.0.0-rc1" const version = "v2.0.0-rc3"
func main() { func main() {
showVersion := flag.Bool("version", false, "print the version and exit") showVersion := flag.Bool("version", false, "print the version and exit")

@ -28,7 +28,7 @@ func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated
g := gen.NewGeneratedFile(filename, file.GoImportPath) g := gen.NewGeneratedFile(filename, file.GoImportPath)
g.P("// Code generated by protoc-gen-go-http. DO NOT EDIT.") g.P("// Code generated by protoc-gen-go-http. DO NOT EDIT.")
g.P("// versions:") g.P("// versions:")
g.P(fmt.Sprintf("// protoc-gen-go-http %s", Version)) g.P(fmt.Sprintf("// protoc-gen-go-http %s", version))
g.P() g.P()
g.P("package ", file.GoPackageName) g.P("package ", file.GoPackageName)
g.P() g.P()

@ -8,7 +8,7 @@ import (
"google.golang.org/protobuf/types/pluginpb" "google.golang.org/protobuf/types/pluginpb"
) )
const version = "v2.0.0-rc1" const version = "v2.0.0-rc3"
func main() { func main() {
showVersion := flag.Bool("version", false, "print the version and exit") showVersion := flag.Bool("version", false, "print the version and exit")

@ -1,6 +0,0 @@
package main
const (
// Version is protoc-gen-go-http version
Version = "v2.0.0-rc3"
)

@ -1,12 +1,16 @@
package kratos package kratos
import "context" import (
"context"
)
// AppInfo is application context value. // AppInfo is application context value.
type AppInfo struct { type AppInfo struct {
ID string ID string
Name string Name string
Version string Version string
Metadata map[string]string
Endpoints []string
} }
type appKey struct{} type appKey struct{}

Loading…
Cancel
Save