Documentation
¶
Index ¶
- Constants
- Variables
- func MakeKeyName(keyType KeyType, keyDirection KeyDirection) string
- func SafeClose(obj Closable)
- type Closable
- type Key
- type KeyDirection
- type KeyPack
- type KeyPosition
- type KeyStore
- func (k *KeyStore) AddKeyPack(packId uuid.UUID) (pack *KeyPack, err error)
- func (k *KeyStore) Close()
- func (k *KeyStore) GetKeyPack(packId uuid.UUID) (pack *KeyPack, ok bool)
- func (k *KeyStore) ImportKeyPack(src string) (pack *KeyPack, err error)
- func (k *KeyStore) RemoveKeyPack(packId uuid.UUID)
- func (k *KeyStore) TryDecodePackId(idKeyPos int64, encId []byte) (id uuid.UUID, ok bool)
- type KeyType
Constants ¶
View Source
const DefaultPermMode = 0o700
Variables ¶
View Source
var ErrOutOfBound = errors.New("requested key slice is out of the key's bounds")
View Source
var ErrPackageExists = errors.New("this package already exists")
Functions ¶
func MakeKeyName ¶
func MakeKeyName(keyType KeyType, keyDirection KeyDirection) string
Types ¶
type Key ¶
type Key struct { *gofile.BufferedFile KeyType KeyType KeyDirection KeyDirection Pos *KeyPosition // contains filtered or unexported fields }
func (*Key) ExportShared ¶
func (*Key) GenerateKey ¶
Generates new key parts
func (*Key) ImportShared ¶
type KeyDirection ¶
type KeyDirection int
const ( KeyIn KeyDirection = iota KeyOut )
func (KeyDirection) String ¶
func (k KeyDirection) String() string
type KeyPack ¶
type KeyPack struct { PackId uuid.UUID IdIn *Key IdOut *Key PayloadIn *Key PayloadOut *Key // contains filtered or unexported fields }
KeyPack contains all the keys needed for a chat - id key, payload key etc
func (*KeyPack) ExportShared ¶
func (*KeyPack) GenerateKey ¶
generates new key part of the same size for all of the keys
func (*KeyPack) ImportShared ¶
type KeyPosition ¶
type KeyPosition struct {
// contains filtered or unexported fields
}
func NewKeyPosition ¶
func NewKeyPosition(filePath string, perm fs.FileMode) (pos *KeyPosition, err error)
type KeyStore ¶
func NewKeyStore ¶
func (*KeyStore) AddKeyPack ¶
Creates a new key pack and stores it, so that can be easily accessed later
func (*KeyStore) GetKeyPack ¶
func (*KeyStore) ImportKeyPack ¶
func (*KeyStore) RemoveKeyPack ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.