minor changes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
09653c2fb2
commit
e3545532e8
@ -14,7 +14,7 @@ var (
|
||||
MeterName = "Meter"
|
||||
|
||||
MeterEndpoints = []api.Endpoint{
|
||||
api.Endpoint{
|
||||
{
|
||||
Name: "Meter.Metrics",
|
||||
Path: []string{"/metrics"},
|
||||
Method: []string{"GET"},
|
||||
|
@ -14,19 +14,19 @@ var (
|
||||
HealthName = "Health"
|
||||
|
||||
HealthEndpoints = []api.Endpoint{
|
||||
api.Endpoint{
|
||||
{
|
||||
Name: "Health.Live",
|
||||
Path: []string{"/live"},
|
||||
Method: []string{"GET"},
|
||||
Handler: "rpc",
|
||||
},
|
||||
api.Endpoint{
|
||||
{
|
||||
Name: "Health.Ready",
|
||||
Path: []string{"/ready"},
|
||||
Method: []string{"GET"},
|
||||
Handler: "rpc",
|
||||
},
|
||||
api.Endpoint{
|
||||
{
|
||||
Name: "Health.Version",
|
||||
Path: []string{"/version"},
|
||||
Method: []string{"GET"},
|
||||
|
@ -1,9 +1,12 @@
|
||||
package id
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"math"
|
||||
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
id, err := New(opts...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
logger.Fatal(context.TODO(), err)
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user