github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/tlfhandle/interfaces.go (about) 1 // Copyright 2019 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 tlfhandle 6 7 import ( 8 "context" 9 10 "github.com/keybase/client/go/kbfs/tlf" 11 ) 12 13 // IDGetter is an interface for resolving TLF handles to their TLF IDs. 14 type IDGetter interface { 15 // GetIDForHandle returns the tlf.ID associated with the given 16 // handle, if the logged-in user has read permission on the 17 // folder. It may or may not create the folder if it doesn't 18 // exist yet, and it may return `tlf.NullID` with a `nil` error if 19 // it doesn't create a missing folder. 20 GetIDForHandle(ctx context.Context, handle *Handle) (tlf.ID, error) 21 // ValidateLatestHandleForTLF returns true if the TLF ID contained 22 // in `h` does not currently map to a finalized TLF. 23 ValidateLatestHandleNotFinal(ctx context.Context, h *Handle) ( 24 bool, error) 25 }