fix: remove redundante names
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 37s
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 37s
This commit is contained in:
@@ -10,20 +10,20 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type RandomService interface {
|
||||
type Random interface {
|
||||
Bytes(size int) ([]byte, error)
|
||||
String(size int) (string, error)
|
||||
UUID() (uuid.UUID, error)
|
||||
}
|
||||
|
||||
type RandomServiceImpl struct {
|
||||
type RandomImpl struct {
|
||||
}
|
||||
|
||||
func NewRandomServiceImpl() *RandomServiceImpl {
|
||||
return &RandomServiceImpl{}
|
||||
func NewRandomImpl() *RandomImpl {
|
||||
return &RandomImpl{}
|
||||
}
|
||||
|
||||
func (r *RandomServiceImpl) Bytes(size int) ([]byte, error) {
|
||||
func (r *RandomImpl) Bytes(size int) ([]byte, error) {
|
||||
b := make([]byte, 32)
|
||||
_, err := rand.Read(b)
|
||||
if err != nil {
|
||||
@@ -34,7 +34,7 @@ func (r *RandomServiceImpl) Bytes(size int) ([]byte, error) {
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func (r *RandomServiceImpl) String(size int) (string, error) {
|
||||
func (r *RandomImpl) String(size int) (string, error) {
|
||||
bytes, err := r.Bytes(size)
|
||||
if err != nil {
|
||||
return "", types.ErrInternal
|
||||
@@ -43,6 +43,6 @@ func (r *RandomServiceImpl) String(size int) (string, error) {
|
||||
return base64.StdEncoding.EncodeToString(bytes), nil
|
||||
}
|
||||
|
||||
func (r *RandomServiceImpl) UUID() (uuid.UUID, error) {
|
||||
func (r *RandomImpl) UUID() (uuid.UUID, error) {
|
||||
return uuid.NewRandom()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user