github.com/cilium/cilium@v1.16.2/pkg/lock/lockfile/lockfile_other.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 //go:build !linux 5 6 package lockfile 7 8 import ( 9 "context" 10 "fmt" 11 ) 12 13 // Lockfile is a simple wrapper around POSIX file locking 14 // but it uses Linux's per-fd locks, which makes it safe to 15 // use within the same process 16 type Lockfile struct { 17 } 18 19 // NewLockfile creates and opens a lockfile, but does not acquire 20 // a lock. 21 func NewLockfile(path string) (*Lockfile, error) { 22 return nil, fmt.Errorf("not implemented") 23 } 24 25 func (l *Lockfile) Close() error { 26 return fmt.Errorf("not implemented") 27 } 28 29 func (l *Lockfile) TryLock(exclusive bool) error { 30 return fmt.Errorf("not implemented") 31 } 32 33 func (l *Lockfile) Lock(ctx context.Context, exclusive bool) error { 34 return fmt.Errorf("not implemented") 35 } 36 37 func (l *Lockfile) Unlock() error { 38 return fmt.Errorf("not implemented") 39 }