service

package
v0.0.0-...-312ee99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrMaxSize = 1024
)

Service constants

Variables

View Source
var (
	ErrMaxSize = errors.New("maximum size of 1024 bytes exceeded")

	ErrStrValue = errors.New("error str value to Integer")
)

Service errors

Functions

This section is empty.

Types

type Service

type Service interface {
	// Concat a and b
	Concat(a, b string) (string, error)

	// a,b pkg string value
	Diff(ctx context.Context, a, b string) (string, error)

	// HealthCheck check service health status
	HealthCheck() bool
}

Service Define a service interface

type ServiceMiddleware

type ServiceMiddleware func(Service) Service

ServiceMiddleware define service middleware

type StringService

type StringService struct {
}

ArithmeticService implement Service interface

func (StringService) Concat

func (s StringService) Concat(a, b string) (string, error)

func (StringService) Diff

func (s StringService) Diff(ctx context.Context, a, b string) (string, error)

func (StringService) HealthCheck

func (s StringService) HealthCheck() bool

HealthCheck implement Service method 用于检查服务的健康状态,这里仅仅返回true。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL