summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-10-27 21:43:01 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-10-28 21:36:37 +0900
commit5d7ecf5a9e68bcd1a71bc6468e0075f1f9d028ba (patch)
treee2573a7156d685732720bfb74e7e4220ab13e533 /pkg/server/server.go
parentd032c3153e72ab3c01355a20098ac1b68d26cba5 (diff)
move NewAPIPolicyAssignmentFromTableStruct() from server/
The table is an internal package so it should not be exported. NewAPIPolicyAssignmentFromTableStruct() is approprate for table/. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r--pkg/server/server.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go
index a870429d..379daa67 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -2331,7 +2331,7 @@ func (s *BgpServer) ListPath(ctx context.Context, r *api.ListPathRequest) ([]*ap
Paths: make([]*api.Path, 0, len(dst.GetAllKnownPathList())),
}
for i, path := range dst.GetAllKnownPathList() {
- p := ToPathApi(path, getValidation(v, idx))
+ p := toPathApi(path, getValidation(v, idx))
idx++
if i == 0 && !table.SelectionOptions.DisableBestPathSelection {
switch r.Type {
@@ -3023,7 +3023,7 @@ func (s *BgpServer) AddDefinedSet(ctx context.Context, r *api.AddDefinedSetReque
if r == nil || r.DefinedSet == nil {
return fmt.Errorf("invalid request")
}
- set, err := NewDefinedSetFromApiStruct(r.DefinedSet)
+ set, err := newDefinedSetFromApiStruct(r.DefinedSet)
if err != nil {
return err
}
@@ -3036,7 +3036,7 @@ func (s *BgpServer) DeleteDefinedSet(ctx context.Context, r *api.DeleteDefinedSe
if r == nil || r.DefinedSet == nil {
return fmt.Errorf("invalid request")
}
- set, err := NewDefinedSetFromApiStruct(r.DefinedSet)
+ set, err := newDefinedSetFromApiStruct(r.DefinedSet)
if err != nil {
return err
}
@@ -3060,7 +3060,7 @@ func (s *BgpServer) AddStatement(ctx context.Context, r *api.AddStatementRequest
if r == nil || r.Statement == nil {
return fmt.Errorf("invalid request")
}
- st, err := NewStatementFromApiStruct(r.Statement)
+ st, err := newStatementFromApiStruct(r.Statement)
if err != nil {
return err
}
@@ -3073,7 +3073,7 @@ func (s *BgpServer) DeleteStatement(ctx context.Context, r *api.DeleteStatementR
if r == nil || r.Statement == nil {
return fmt.Errorf("invalid request")
}
- st, err := NewStatementFromApiStruct(r.Statement)
+ st, err := newStatementFromApiStruct(r.Statement)
if err == nil {
err = s.policy.DeleteStatement(st, r.All)
}
@@ -3085,7 +3085,7 @@ func (s *BgpServer) ListPolicy(ctx context.Context, r *api.ListPolicyRequest) ([
l := make([]*api.Policy, 0)
s.mgmtOperation(func() error {
for _, p := range s.policy.GetPolicy(r.Name) {
- l = append(l, toPolicyApi(p))
+ l = append(l, table.ToPolicyApi(p))
}
return nil
}, false)
@@ -3193,7 +3193,7 @@ func (s *BgpServer) ListPolicyAssignment(ctx context.Context, r *api.ListPolicyA
Default: rt,
Policies: policies,
}
- a = append(a, NewAPIPolicyAssignmentFromTableStruct(t))
+ a = append(a, table.NewAPIPolicyAssignmentFromTableStruct(t))
}
}
return nil