github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/kbfsmd/revision.go (about) 1 // Copyright 2017 Keybase Inc. All rights reserved. 2 // Use of this source code is governed by a BSD 3 // license that can be found in the LICENSE file. 4 5 package kbfsmd 6 7 import "strconv" 8 9 // Revision is the type for the revision number. 10 // This is currently int64 since that's the type of Avro's long. 11 type Revision int64 12 13 // String converts a Revision to its string form. 14 func (mr Revision) String() string { 15 return strconv.FormatInt(mr.Number(), 10) 16 } 17 18 // Number casts a Revision to it's primitive type. 19 func (mr Revision) Number() int64 { 20 return int64(mr) 21 } 22 23 const ( 24 // RevisionUninitialized indicates that a top-level folder has 25 // not yet been initialized. 26 RevisionUninitialized = Revision(0) 27 // RevisionInitial is always the first revision for an 28 // initialized top-level folder. 29 RevisionInitial = Revision(1) 30 )