Global Resource ID
Overview
GRID is a package that can be used to uniquely identify resources using Global Resource IDs (GRIDs). The GRID format is:
grid:namespace:owner:resource_type:resource_id
TODO: Potential change grid:namespace:service:resouce_type:resource_id
grid::mashup:verse:v123
grid:prod:tbp:video:v123
grid:dev:tbp:video:v456
grid:prod:accounts:user:u123
Download
To download this package, run:
go get github.com/zpatrick/grid
Usage
This code is taken from the example located in this repo.
package main
import (
"fmt"
"log"
"github.com/zpatrick/grid"
)
func main() {
g, err := grid.Parse("grid:facebook:user123:comment:88532")
if err != nil {
log.Fatal(err)
}
fmt.Println("GRID: ", g.String())
fmt.Println("Namespace: ", g.Namespace)
fmt.Println("Owner: ", g.Owner)
fmt.Println("Resource Type:", g.ResourceType)
fmt.Println("Resource ID: ", g.ResourceID)
}
Output:
$ go run main.go
GRID: grid:facebook:comment:88532
Namespace: facebook
Owner: user123
Resource Type: comment
Resource ID: 88532
License
This work is published under the MIT license.
Please see the LICENSE file for details.