fix: remove redundante names
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 44s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 49s

This commit was merged in pull request #299.
This commit is contained in:
2024-12-04 23:22:25 +01:00
parent 2d5f42bb28
commit 5ef59df2d0
16 changed files with 228 additions and 230 deletions

View File

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