-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
176 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright © by Jeff Foley 2017-2024. All rights reserved. | ||
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package open_asset_model | ||
|
||
type Relation interface { | ||
RelationType() RelationType | ||
JSON() ([]byte, error) | ||
} | ||
|
||
type RelationType string | ||
|
||
const ( | ||
SimpleRelation RelationType = "SimpleRelation" | ||
PortRelation RelationType = "PortRelation" | ||
) | ||
|
||
var RelationList = []RelationType{ | ||
PortRelation, | ||
SimpleRelation, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright © by Jeff Foley 2017-2024. All rights reserved. | ||
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package relation | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
model "github.com/owasp-amass/open-asset-model" | ||
) | ||
|
||
// SimpleRelation represents a simple relation in the graph with no additional data required. | ||
type SimpleRelation struct{} | ||
|
||
// RelationType implements the Relation interface. | ||
func (r SimpleRelation) RelationType() model.RelationType { | ||
return model.SimpleRelation | ||
} | ||
|
||
// JSON implements the Relation interface. | ||
func (r SimpleRelation) JSON() ([]byte, error) { | ||
return json.Marshal(r) | ||
} |
Oops, something went wrong.