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"
MeterEndpoints = []api.Endpoint{
api.Endpoint{
{
Name: "Meter.Metrics",
Path: []string{"/metrics"},
Method: []string{"GET"},

View File

@ -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"},

View File

@ -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
}