service.go 1 2 3 4 5 6 7 8 9 10 11 12 13 type Service interface { Status(ctx context.Context) (string, error) } type statusService struct{} func NewService() Service { return statusService{} } func (statusService) Status(ctx context.Context) (string, error) { return "ok", nil } endpoints.go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 type statusRequest struct{} type statusResponse