Skip to content

Commit

Permalink
entoas: export EdgeViewName to make it accessible for implementation …
Browse files Browse the repository at this point in the history
…generators (#197)
  • Loading branch information
masseelch authored Jan 5, 2022
1 parent 5255cb0 commit b87dbe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions entoas/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func createEdgeOp(spec *ogen.Spec, n *gen.Type, e *gen.Edge) (*ogen.Operation, e
if err != nil {
return nil, err
}
vn, err := edgeViewName(n, e, OpCreate)
vn, err := EdgeViewName(n, e, OpCreate)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -372,7 +372,7 @@ func readEdgeOp(spec *ogen.Spec, n *gen.Type, e *gen.Edge) (*ogen.Operation, err
if err != nil {
return nil, err
}
vn, err := edgeViewName(n, e, OpRead)
vn, err := EdgeViewName(n, e, OpRead)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -537,7 +537,7 @@ func listEdgeOp(spec *ogen.Spec, n *gen.Type, e *gen.Edge) (*ogen.Operation, err
if err != nil {
return nil, err
}
vn, err := edgeViewName(n, e, OpList)
vn, err := EdgeViewName(n, e, OpList)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions entoas/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Views(g *gen.Graph) (map[string]*View, error) {
if err != nil {
return nil, err
}
vn, err := edgeViewName(n, e, op)
vn, err := EdgeViewName(n, e, op)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -224,8 +224,8 @@ func ViewName(n *gen.Type, op Operation) (string, error) { // TODO(masseelch): A
return n.Name + op.Title(), nil
}

// edgeViewName returns the name for a view for a given 2nd leve operation on a gen.Edge.
func edgeViewName(n *gen.Type, e *gen.Edge, op Operation) (string, error) { // TODO(masseelch): Add tests for collisions
// EdgeViewName returns the name for a view for a given 2nd leve operation on a gen.Edge.
func EdgeViewName(n *gen.Type, e *gen.Edge, op Operation) (string, error) { // TODO(masseelch): Add tests for collisions
cfg, err := GetConfig(n.Config)
if err != nil {
return "", err
Expand Down

0 comments on commit b87dbe8

Please sign in to comment.