minor changes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-08-21 01:00:10 +03:00
parent 09653c2fb2
commit e3545532e8
3 changed files with 9 additions and 6 deletions

View File

@ -14,7 +14,7 @@ var (
MeterName = "Meter" MeterName = "Meter"
MeterEndpoints = []api.Endpoint{ MeterEndpoints = []api.Endpoint{
api.Endpoint{ {
Name: "Meter.Metrics", Name: "Meter.Metrics",
Path: []string{"/metrics"}, Path: []string{"/metrics"},
Method: []string{"GET"}, Method: []string{"GET"},

View File

@ -14,19 +14,19 @@ var (
HealthName = "Health" HealthName = "Health"
HealthEndpoints = []api.Endpoint{ HealthEndpoints = []api.Endpoint{
api.Endpoint{ {
Name: "Health.Live", Name: "Health.Live",
Path: []string{"/live"}, Path: []string{"/live"},
Method: []string{"GET"}, Method: []string{"GET"},
Handler: "rpc", Handler: "rpc",
}, },
api.Endpoint{ {
Name: "Health.Ready", Name: "Health.Ready",
Path: []string{"/ready"}, Path: []string{"/ready"},
Method: []string{"GET"}, Method: []string{"GET"},
Handler: "rpc", Handler: "rpc",
}, },
api.Endpoint{ {
Name: "Health.Version", Name: "Health.Version",
Path: []string{"/version"}, Path: []string{"/version"},
Method: []string{"GET"}, Method: []string{"GET"},

View File

@ -1,9 +1,12 @@
package id package id
import ( import (
"context"
"crypto/rand" "crypto/rand"
"errors" "errors"
"math" "math"
"github.com/unistack-org/micro/v3/logger"
) )
// DefaultAlphabet is the alphabet used for ID characters by default // DefaultAlphabet is the alphabet used for ID characters by default
@ -64,11 +67,11 @@ func New(opts ...Option) (string, error) {
} }
} }
// Must is the same as New but panics on error // Must is the same as New but fatals on error
func Must(opts ...Option) string { func Must(opts ...Option) string {
id, err := New(opts...) id, err := New(opts...)
if err != nil { if err != nil {
panic(err) logger.Fatal(context.TODO(), err)
} }
return id return id
} }