Skip to content
Calculates a unique hash based identifier for a Go interface.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
LICENSE
README.md
interface_guid.go
interface_guid_test.go

README.md

interfaceGUID

interfaceGUID exposes a single function CalculateGUID which calculates a unique deterministic value based on the type provided. It is to be used when communicating with remote services to quickly assert common knowledge before starting to communicate, for example via encoding/gob.

GoDoc Build Status Coverage Status

Example

type MyService interface {
  ...
}

guid := interfaceGUID.CalculateGUID(reflect.TypeOf((*MyService)(nil)).Elem())
// Then compare the string with the remote service.
You can’t perform that action at this time.