Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

sixafter/graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

graph

A Go library for creating and manipulating graph data structures.

Go Report Card License: Apache 2.0 Go Go Reference


Status

Build & Test

CI GitHub issues

Quality

Quality Gate Status CodeQL

Package and Deploy

Release


Features

This Go-based graph library is designed for versatility, performance, and extensibility, leveraging generics to handle various graph-related operations seamlessly. Key features include:

  • Generics-Based Design: Leverages Go generics for a flexible and type-safe graph interface supporting custom vertex and edge types.
  • Trait-Driven Configuration: Supports traits such as directed/undirected, weighted, acyclic, rooted, and multigraph properties.
  • Comprehensive Graph Operations: Provides efficient algorithms for CRUD operations, set operations, adjacency/predecessor maps, and graph cloning.
  • Traversal and Pathfinding: Implements breadth-first, depth-first, and shortest-path algorithms. Supports minimum and maximum spanning tree computation.
  • Graph Metrics: Offers centrality measures (degree, closeness, betweenness, eigenvector), clustering coefficients, density, diameter, and average path length.
  • Community and Ranking Analysis: Includes modularity and PageRank calculations for advanced graph analysis.
  • Cycle Management: Prevents cycles in acyclic graphs during edge additions.
  • Streaming Support: Enables paginated streaming of vertices and edges with context management for cancellation and resumption.
  • Customizable Input/Output: Supports flexible graph serialization and custom reader/writer implementations.
  • Concurrency Safe: Designed for thread-safe operations in multi-threaded environments.
  • Lightweight and Efficient: Optimized for high performance with minimal overhead.
  • Zero Dependencies: Lightweight implementation with no external dependencies beyond the standard library.
  • Supports io.Reader Interface:
    • Graph Serialization: Export and import graphs to/from various formats for interoperability.
    • Customizable Readers and Writers: Create tailored I/O operations for graph persistence.

Verify with Cosign

Cosign is used to sign releases for integrity verification.

To verify the integrity of the release tarball, you can use Cosign to check the signature and checksums. Follow these steps:

# Fetch the latest release tag from GitHub API (e.g., "v0.12.0")
TAG=$(curl -s https://api.github.com/repos/sixafter/graph/releases/latest | jq -r .tag_name)

# Remove leading "v" for filenames (e.g., "v0.12.0" -> "0.12.0")
VERSION=${TAG#v}

# ---------------------------------------------------------------------
# Verify the source archive using Sigstore bundles
# ---------------------------------------------------------------------

# Download the release tarball and its signature bundle
curl -LO "https://github.com/sixafter/graph/releases/download/${TAG}/graph-${VERSION}.tar.gz"
curl -LO "https://github.com/sixafter/graph/releases/download/${TAG}/graph-${VERSION}.tar.gz.sigstore.json"

# Verify the tarball with Cosign using the published public key
cosign verify-blob \
  --key "https://raw.githubusercontent.com/sixafter/graph/main/cosign.pub" \
  --bundle "graph-${VERSION}.tar.gz.sigstore.json" \
  "graph-${VERSION}.tar.gz"

# ---------------------------------------------------------------------
# Verify the checksums manifest using Sigstore bundles
# ---------------------------------------------------------------------

curl -LO "https://github.com/sixafter/graph/releases/download/${TAG}/checksums.txt"
curl -LO "https://github.com/sixafter/graph/releases/download/${TAG}/checksums.txt.sigstore.json"

cosign verify-blob \
  --key "https://raw.githubusercontent.com/sixafter/graph/main/cosign.pub" \
  --bundle "checksums.txt.sigstore.json" \
  "checksums.txt"

# ---------------------------------------------------------------------
# Confirm local artifact integrity
# ---------------------------------------------------------------------

shasum -a 256 -c checksums.txt

If valid, Cosign will output:

Verified OK

Verify Go module

To validate that the Go module archive served by GitHub, go mod download, and the Go proxy are all consistent, run the module-verify target. This performs a full cross-check of the tag archive and module ZIPs to confirm they match byte-for-byte.


Installation

Using go get

To install this package, run the following command:

go get -u github.com/sixafter/graph

To use the package in your Go project, import it as follows:

import "github.com/sixafter/graph"

Contributing

Contributions are welcome. See CONTRIBUTING


License

This project is licensed under the Apache 2.0 License. See LICENSE file.

About

A Go library for creating and manipulating graph structures.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published