From f1c55ca0bf844c500a5516ddcd34feb78aed833a Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sun, 28 Oct 2018 20:50:51 +0900 Subject: server: make NewPolicyFromApiStruct() unexported Signed-off-by: FUJITA Tomonori --- pkg/server/grpc_server.go | 6 +++--- pkg/server/server.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/server') 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 } -- cgit v1.2.3