diff --git a/api.go b/api.go index 30fd0f1f8d4b430776ccf3ed33b700af610155dd..0d63f4c66ed3bc2e204ca9c7ec4d92cc57d1cfec 100644 --- a/api.go +++ b/api.go @@ -12,14 +12,26 @@ import ( "time" ) -var ( - MasterElectionPath = "/icecast/cluster/master" - MountPrefix = "/icecast/mounts/" - NodePrefix = "/icecast/nodes/" +const ( + // Path to the mount configuration in etcd. This should never + // change, upgrades to the configuration format should be + // backwards-compatible. + MountPrefix = "/icecast/mounts/" + + // Path for the cluster runtime data. Whenever the format of + // this data changes, the ABIVersion should be increased. A + // rolling restart of the cluster will then seamlessly cause a + // transition to the new consensus (the cluster will be + // partitioned in the meantime). + ABIVersion = "2" + MasterElectionPath = "/icecast/" + ABIVersion + "/cluster/master" + NodePrefix = "/icecast/" + ABIVersion + "/nodes/" IcecastPort = 8000 IcecastMountPrefix = "/_stream" +) +var ( ErrIsDirectory = errors.New("key is a directory") ErrIsFile = errors.New("key is a file") )