diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-28 20:50:51 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-28 21:45:41 +0900 |
commit | f1c55ca0bf844c500a5516ddcd34feb78aed833a (patch) | |
tree | d5966092c04068e655e4b4ec54aca3e4aea287a2 /pkg/server | |
parent | 3e950780fedccacdd1e1267343b5b9baae204566 (diff) |
server: make NewPolicyFromApiStruct() unexported
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/grpc_server.go | 6 | ||||
-rw-r--r-- | pkg/server/server.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go index 9f6b5bbb..eb17c69f 100644 --- a/pkg/server/grpc_server.go +++ b/pkg/server/grpc_server.go @@ -300,7 +300,7 @@ func (s *Server) SetPolicies(ctx context.Context, r *api.SetPoliciesRequest) (*e func NewRoutingPolicyFromApiStruct(arg *api.SetPoliciesRequest) (*config.RoutingPolicy, error) { policyDefinitions := make([]config.PolicyDefinition, 0, len(arg.Policies)) for _, p := range arg.Policies { - pd, err := NewConfigPolicyFromApiStruct(p) + pd, err := newConfigPolicyFromApiStruct(p) if err != nil { return nil, err } @@ -1625,7 +1625,7 @@ func (s *Server) DeleteStatement(ctx context.Context, r *api.DeleteStatementRequ return &empty.Empty{}, s.bgpServer.DeleteStatement(ctx, r) } -func NewConfigPolicyFromApiStruct(a *api.Policy) (*config.PolicyDefinition, error) { +func newConfigPolicyFromApiStruct(a *api.Policy) (*config.PolicyDefinition, error) { if a.Name == "" { return nil, fmt.Errorf("empty policy name") } @@ -1647,7 +1647,7 @@ func NewConfigPolicyFromApiStruct(a *api.Policy) (*config.PolicyDefinition, erro }, nil } -func NewPolicyFromApiStruct(a *api.Policy) (*table.Policy, error) { +func newPolicyFromApiStruct(a *api.Policy) (*table.Policy, error) { if a.Name == "" { return nil, fmt.Errorf("empty policy name") } diff --git a/pkg/server/server.go b/pkg/server/server.go index 379daa67..d250b099 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -3097,7 +3097,7 @@ func (s *BgpServer) AddPolicy(ctx context.Context, r *api.AddPolicyRequest) erro if r == nil || r.Policy == nil { return fmt.Errorf("invalid request") } - p, err := NewPolicyFromApiStruct(r.Policy) + p, err := newPolicyFromApiStruct(r.Policy) if err == nil { err = s.policy.AddPolicy(p, r.ReferExistingStatements) } @@ -3110,7 +3110,7 @@ func (s *BgpServer) DeletePolicy(ctx context.Context, r *api.DeletePolicyRequest if r == nil || r.Policy == nil { return fmt.Errorf("invalid request") } - p, err := NewPolicyFromApiStruct(r.Policy) + p, err := newPolicyFromApiStruct(r.Policy) if err != nil { return err } |