Skip to content
Snippets Groups Projects
Commit 97c4019a authored by Alena Petraki's avatar Alena Petraki
Browse files

Правки импортов

parent 54e45022
Branches
Tags
No related merge requests found
......@@ -5,7 +5,7 @@ package mocks
import (
"context"
roles "git.perx.ru/perxis/perxis-go/pkg/role"
roles "git.perx.ru/perxis/perxis-go/pkg/roles"
"github.com/stretchr/testify/mock"
)
......
package roles
//go:generate gowrap gen -i Roles -t ../../templates/middleware/middleware -o service/middleware.go
//go:generate gowrap gen -i Roles -t ../../templates/middleware/error_log -o service/error_logging_middleware.go
//go:generate gowrap gen -i Roles -t ../../templates/middleware/access_log -o service/logging_middleware.go
//go:generate gowrap gen -i Roles -t ../../templates/middleware/recovery -o service/recovering_middleware.go
//go:generate gowrap gen -i Roles -t ../../templates/middleware/telemetry -o service/telemetry_middleware.go
import (
"context"
"git.perx.ru/perxis/perxis-go/pkg/data"
"git.perx.ru/perxis/perxis-go/pkg/environments"
"git.perx.ru/perxis/perxis-go/pkg/permission"
"git.perx.ru/perxis/perxis-go/pkg/util"
)
const (
AnonymousRole = "anonymous"
AuthorizedRole = "authorized"
ViewRole = "view"
// Deprecated
AuthorizedClientsRole = "authorized_clients"
)
type Role struct {
......@@ -44,17 +35,13 @@ type Role struct {
}
// @microgen grpc
// @protobuf git.perx.ru/perxis/perxis/proto/roles
// @protobuf git.perx.ru/perxis/perxis-go/proto/roles
// @grpc-addr content.roles.Roles
type Roles interface {
Create(ctx context.Context, role *Role) (created *Role, err error)
Get(ctx context.Context, spaceId, roleId string) (role *Role, err error)
List(ctx context.Context, spaceId string) (roles []*Role, err error)
Update(ctx context.Context, role *Role) (err error)
Delete(ctx context.Context, spaceId, roleId string) (err error)
}
......@@ -68,7 +55,7 @@ func (r Role) CanAccessEnvironment(ctx context.Context, service environments.Env
r.Environments = []string{environments.DefaultEnvironment}
}
if util.Contains(envID, r.Environments) {
if data.Contains(envID, r.Environments) {
return true
}
......@@ -80,7 +67,7 @@ func (r Role) CanAccessEnvironment(ctx context.Context, service environments.Env
aliases := append(e.Aliases, e.ID)
for _, ce := range r.Environments {
if util.Contains(ce, aliases) {
if data.Contains(ce, aliases) {
return true
}
}
......
......@@ -5,7 +5,7 @@ package transport
import (
"context"
"errors"
roles "git.perx.ru/perxis/perxis/services/roles"
roles "git.perx.ru/perxis/perxis-go/pkg/roles"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
......
......@@ -2,7 +2,7 @@
package transport
import roles "git.perx.ru/perxis/perxis/services/roles"
import roles "git.perx.ru/perxis/perxis-go/pkg/roles"
type (
CreateRequest struct {
......
......@@ -3,7 +3,7 @@
package transportgrpc
import (
transport "git.perx.ru/perxis/perxis-go/pkg/role/transport"
transport "git.perx.ru/perxis/perxis-go/pkg/roles/transport"
pb "git.perx.ru/perxis/perxis-go/proto/roles"
grpckit "github.com/go-kit/kit/transport/grpc"
empty "github.com/golang/protobuf/ptypes/empty"
......
......@@ -7,8 +7,8 @@ import (
"context"
"errors"
transport "git.perx.ru/perxis/perxis-go/pkg/roles/transport"
pb "git.perx.ru/perxis/perxis-go/proto/roles"
transport "git.perx.ru/perxis/perxis/services/roles/transport"
empty "github.com/golang/protobuf/ptypes/empty"
)
......
......@@ -5,10 +5,10 @@
package transportgrpc
import (
permission "git.perx.ru/perxis/perxis-go/pkg/permission"
service "git.perx.ru/perxis/perxis-go/pkg/roles"
commonpb "git.perx.ru/perxis/perxis-go/proto/common"
pb "git.perx.ru/perxis/perxis-go/proto/roles"
permission "git.perx.ru/perxis/perxis/pkg/permission"
service "git.perx.ru/perxis/perxis/services/roles"
)
func PtrRoleToProto(role *service.Role) (*pb.Role, error) {
......
......@@ -4,8 +4,8 @@
package transportgrpc
import (
transport "git.perx.ru/perxis/perxis-go/pkg/roles/transport"
pb "git.perx.ru/perxis/perxis-go/proto/roles"
transport "git.perx.ru/perxis/perxis/services/roles/transport"
grpc "github.com/go-kit/kit/transport/grpc"
empty "github.com/golang/protobuf/ptypes/empty"
context "golang.org/x/net/context"
......
......@@ -4,7 +4,7 @@ package transport
import (
"context"
roles "git.perx.ru/perxis/perxis/services/roles"
roles "git.perx.ru/perxis/perxis-go/pkg/roles"
endpoint "github.com/go-kit/kit/endpoint"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment