interfaces

package
v0.0.0-...-32d88a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adder

type Adder[E any] interface {
	Add(E) error
}

type AdderCustom

type AdderCustom[E any] interface {
	AddCustomKey(E, func(E) string) error
}

type AdderPtr

type AdderPtr[E any, EPtr Ptr[E]] interface {
	AddPtr(EPtr) error
}

type Blob

type Blob[T any] interface{}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobGetter

type BlobGetter[
	V any,
] interface {
	GetBlob(Sha) (V, error)
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobGetterPutter

type BlobGetterPutter[
	V any,
] interface {
	BlobGetter[V]
	BlobPutter[V]
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobIOFactory

type BlobIOFactory interface {
	BlobReaderFactory
	BlobWriterFactory
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobPtr

type BlobPtr[T any] interface {
	Blob[T]
	Ptr[T]
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobPutter

type BlobPutter[
	V any,
] interface {
	PutBlob(V)
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobReaderFactory

type BlobReaderFactory interface {
	BlobReader(ShaGetter) (ShaReadCloser, error)
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type BlobWriterFactory

type BlobWriterFactory interface {
	BlobWriter() (ShaWriteCloser, error)
}

Blobs represent persisted files, like blobs in Git. Blobs are used by Zettels, types, tags, config, and inventory lists.

type CacheIOFactory

type CacheIOFactory interface {
	ReadCloserCache(string) (ShaReadCloser, error)
	WriteCloserCache(string) (ShaWriteCloser, error)
}

type Cloner

type Cloner[E any] interface {
	Clone() E
}

type Collection

type Collection[T any] interface {
	Lenner
	Iterable[T]
}

type CollectionOld

type CollectionOld[T any] interface {
	Lenner
	Iterable[T]
	Each(FuncIter[T]) error // TODO remove in favor of iter.Seq
}

type CollectionPtr

type CollectionPtr[T any, TPtr Ptr[T]] interface {
	Lenner
	IterablePtr[T, TPtr]
}

type CompoundKeyer

type CompoundKeyer[T any] []StringKeyer[T]

func (CompoundKeyer[T]) GetKey

func (ck CompoundKeyer[T]) GetKey(e T) string

type Config

type Config interface {
	MutableConfig
	ImmutableConfig
	GetTypeStringFromExtension(t string) string
}

type ConfigDryRunReader

type ConfigDryRunReader interface {
	IsDryRun() bool
}

type ConfigDryRunWriter

type ConfigDryRunWriter interface {
	SetDryRun(bool)
}

type ConfigGetFilters

type ConfigGetFilters interface {
	GetFilters() map[string]string
}

type ContainsKeyer

type ContainsKeyer interface {
	ContainsKey(string) bool
}

type Delta

type Delta[T any] interface {
	GetAdded() SetLike[T]
	GetRemoved() SetLike[T]
}

type Directory

type Directory interface {
	DirectoryPaths
	Delete(string) error
}

type DirectoryPaths

type DirectoryPaths interface {
	Dir(p ...string) string
	DirCache(p ...string) string
	DirCacheObjectPointers() string
	DirCacheObjects() string
	DirCacheRepo(p ...string) string
	DirLostAndFound() string
	DirObjectGenre(g GenreGetter) (p string, err error)
	DirObjectId() string
	DirObjects(p ...string) string
	DirZit(p ...string) string
	FileAge() string
	FileCacheDormant() string
	FileCacheObjectId() string
	FileConfigMutable() string
	FileConfigPermanent() string
	FileLock() string
	FileTags() string
}

type Element

type Element interface {
	EqualsAny(any) bool
}

type ElementPtr

type ElementPtr[T any] interface {
	Ptr[T]
	Element
}

type Equaler

type Equaler[T any, TPtr Ptr[T]] interface {
	Equaler1[T]
	EqualsPtr(TPtr, TPtr) bool
}

TODO-P2 rename

type Equaler1

type Equaler1[T any] interface {
	Equals(T, T) bool
}

TODO-P2 rename

type Equatable

type Equatable[T any] interface {
	Equals(T) bool
}

type FileExtensionGetter

type FileExtensionGetter interface {
	GetFileExtensionForGenre(GenreGetter) string
	GetFileExtensionZettel() string
	GetFileExtensionOrganize() string
	GetFileExtensionType() string
	GetFileExtensionTag() string
	GetFileExtensionRepo() string
}

type Flusher

type Flusher interface {
	Flush() error
}

type FuncAbbreviateKorper

type FuncAbbreviateKorper func(StringerWithHeadAndTail) (string, error)

type FuncAbbreviateValue

type FuncAbbreviateValue func(ValueLike) (string, error)

type FuncError

type FuncError func() error

type FuncIter

type FuncIter[T any] func(T) error

type FuncIterIO

type FuncIterIO[T any] func(T) (int64, error)

type FuncIterKey

type FuncIterKey func(string) error

type FuncIterWithKey

type FuncIterWithKey[T any] func(string, T) error

type FuncMakePrinter

type FuncMakePrinter[OUT any] func(WriterAndStringWriter) FuncIter[OUT]

type FuncObjectReader

type FuncObjectReader func(ShaGetter) (ShaReadCloser, error)

type FuncObjectWriter

type FuncObjectWriter func() (ShaWriteCloser, error)

type FuncReader

type FuncReader func(io.Reader) (int64, error)

type FuncReaderElementInterface

type FuncReaderElementInterface[T any] func(io.Writer, T) (int64, error)

type FuncReaderFormat

type FuncReaderFormat[T any] func(io.Reader, *T) (int64, error)

type FuncReaderFormatInterface

type FuncReaderFormatInterface[T any] func(io.Reader, T) (int64, error)

TODO-P3 switch to below

type FuncSetString

type FuncSetString func(string) error

type FuncShaReadCloser

type FuncShaReadCloser func(Sha) (ShaReadCloser, error)

type FuncShaWriteCloser

type FuncShaWriteCloser func(Sha) (ShaWriteCloser, error)

type FuncString

type FuncString[T any] func(T) string

type FuncStringWriterFormat

type FuncStringWriterFormat[T any] func(WriterAndStringWriter, T) (int64, error)

type FuncTransform

type FuncTransform[T any, T1 any] func(T) (T1, error)

type FuncWriter

type FuncWriter func(io.Writer) (int64, error)

type FuncWriterElement

type FuncWriterElement[T any] func(io.Writer, *T) (int64, error)

type FuncWriterElementInterface

type FuncWriterElementInterface[T any] func(io.Writer, T) (int64, error)

type FuncWriterFormat

type FuncWriterFormat[T any] func(io.Writer, T) (int64, error)

type Genre

type Genre interface {
	ObjectId
	EqualsGenre(GenreGetter) bool
	GetGenreBitInt() byte
	GetGenreString() string
	GetGenreStringPlural(StoreVersion) string
}

type GenreGetter

type GenreGetter interface {
	GetGenre() Genre
}

type Id

type Id[T any] interface {
	Value[T]
	GenreGetter
}

type IdPtr

type IdPtr[T any] interface {
	Id[T]
	ValuePtr[T]
	Resetable[T]
}

type ImmutableConfig

type ImmutableConfig interface {
	GetStoreVersion() StoreVersion
}

type ImmutableConfigGetter

type ImmutableConfigGetter interface {
	GetImmutableConfig() ImmutableConfig
}

type IncludesExternal

type IncludesExternal interface {
	IncludesExternal() bool
}

type IncludesHidden

type IncludesHidden interface {
	IncludesHidden() bool
}

type IncludesHistory

type IncludesHistory interface {
	IncludesHistory() bool
}

type IncludesLatest

type IncludesLatest interface {
	IncludesLatest() bool
}

type Iterable

type Iterable[T any] interface {
	Any() T // TODO-P2 remove in favor of collection method
	// Each(FuncIter[T]) error // TODO remove in favor of iter.Seq
	All() iter.Seq[T]
	Lenner
}

type IterablePtr

type IterablePtr[T any, TPtr Ptr[T]] interface {
	EachPtr(FuncIter[TPtr]) error // TODO remove in favor of iter.Seq
	AllPtr() iter.Seq[TPtr]
}

type KeyedIterable

type KeyedIterable[K constraints.Ordered, T any] interface {
	Iterable[T]
	AllPairs() iter.Seq2[K, T]
}

type Lenner

type Lenner interface {
	Len() int
}

type Lessor

type Lessor[T any] interface {
	Less(T) bool
}

TODO-P2 remove

type Lessor2

type Lessor2[T any, TPtr Ptr[T]] interface {
	Lessor3[T]
	LessPtr(TPtr, TPtr) bool
}

TODO-P2 rename

type Lessor3

type Lessor3[T any] interface {
	Less(T, T) bool
}

type LockSmith

type LockSmith interface {
	IsAcquired() bool
	Lock() error
	Unlock() error
}

type LockSmithGetter

type LockSmithGetter interface {
	GetLockSmith() LockSmith
}

type MutableConfig

type MutableConfig interface {
	MutableStoredConfig
	UsePrintTime() bool
	UsePredictableZettelIds() bool
	MutableConfigDryRun
}

type MutableConfigDryRun

type MutableConfigDryRun interface {
	ConfigDryRunReader
	ConfigDryRunWriter
}

type MutableSetLike

type MutableSetLike[T any] interface {
	SetLike[T]
	Adder[T]
	Del(T) error
	DelKey(string) error
	Resetter
}

type MutableSetPtrLike

type MutableSetPtrLike[T any, TPtr Ptr[T]] interface {
	SetPtrLike[T, TPtr]
	MutableSetLike[T]
	AddPtr(TPtr) error
	DelPtr(TPtr) error
}

type MutableStoredConfig

type MutableStoredConfig interface {
	ConfigGetFilters
}

type MutableTridex

type MutableTridex interface {
	Tridex
	Add(string)
	Remove(string)
}

type MutableTridexLike

type MutableTridexLike interface {
	TridexLike
	Add(string)
	Remove(string)
}

type MutableValueSet

type MutableValueSet[T flag.Value, TPtr ValuePtr[T]] interface {
	MutableSetLike[T]
}

type ObjectIOFactory

type ObjectIOFactory interface {
	ObjectReaderFactory
	ObjectWriterFactory
}

func MakeBespokeObjectReadWriterFactory

func MakeBespokeObjectReadWriterFactory(
	r ObjectReaderFactory,
	w ObjectWriterFactory,
) ObjectIOFactory

type ObjectId

type ObjectId interface {
	GenreGetter
	Stringer
}

type ObjectIdWithRepoId

type ObjectIdWithRepoId interface {
	GenreGetter
	RepoIdGetter
	Stringer
}

type ObjectReaderFactory

type ObjectReaderFactory interface {
	ObjectReader(ShaGetter) (ShaReadCloser, error)
}

func MakeBespokeObjectReadFactory

func MakeBespokeObjectReadFactory(
	r FuncObjectReader,
) ObjectReaderFactory

type ObjectWriterFactory

type ObjectWriterFactory interface {
	ObjectWriter() (ShaWriteCloser, error)
}

func MakeBespokeObjectWriteFactory

func MakeBespokeObjectWriteFactory(
	r FuncObjectWriter,
) ObjectWriterFactory

type Pool

type Pool[T Poolable[T], TPtr PoolablePtr[T]] interface {
	PoolValue[TPtr]
	PutMany(...TPtr) error
}

type Pool2

type Pool2[T Poolable[T], TPtr PoolablePtr[T]] interface {
	PoolValue2[TPtr]
	PutMany(...TPtr) error
}

type PoolValue

type PoolValue[T any] interface {
	Get() T
	Put(i T) (err error)
}

type PoolValue2

type PoolValue2[T any] interface {
	Get() (T, error)
	Put(i T) (err error)
}

type Poolable

type Poolable[T any] interface{}

type PoolablePtr

type PoolablePtr[T any] interface {
	Ptr[T]
}

type Ptr

type Ptr[T any] interface {
	*T
}

type RepoId

type RepoId interface {
	Stringer
	EqualsRepoId(RepoIdGetter) bool
	GetRepoIdString() string
}

type RepoIdGetter

type RepoIdGetter interface {
	GetRepoId() RepoId
}

type Resetable

type Resetable[T any] interface {
	Ptr[T]
	ResetWith(T)
	Reset()
}

type Resetter

type Resetter interface {
	Reset()
}

type Resetter2

type Resetter2[T any, TPtr Ptr[T]] interface {
	Reset(TPtr)
	ResetWith(TPtr, TPtr)
}

type Resetter3

type Resetter3[T any] interface {
	Reset(T)
	ResetWith(T, T)
}

type ResetterWithError

type ResetterWithError interface {
	Reset() error
}

type SetLike

type SetLike[T any] interface {
	CollectionOld[T]
	ContainsKeyer

	Key(T) string
	Get(string) (T, bool)
	Contains(T) bool
	EachKey(FuncIterKey) error
	AllKeys() iter.Seq[string]

	CloneSetLike() SetLike[T]
	CloneMutableSetLike() MutableSetLike[T]
}

type SetPtrLike

type SetPtrLike[T any, TPtr Ptr[T]] interface {
	SetLike[T]
	CollectionPtr[T, TPtr]

	GetPtr(string) (TPtr, bool)
	KeyPtr(TPtr) string

	CloneSetPtrLike() SetPtrLike[T, TPtr]
	CloneMutableSetPtrLike() MutableSetPtrLike[T, TPtr]
}

type Setter

type Setter interface {
	Set(string) error
}

type SetterPtr

type SetterPtr[T any] interface {
	Ptr[T]
	Setter
}

type Sha

type Sha interface {
	// TODO-P3
	// GetHashBytes() []byte
	// ValueLike
	StringerWithHeadAndTail
	GetShaString() string
	GetShaBytes() []byte
	EqualsSha(Sha) bool // TODO-P3 rename to EqualsShaLike
	IsNull() bool
	ShaGetter
}

TODO-P3 refactor into hash or checksum or content address and split korper out into context object

type ShaGetter

type ShaGetter interface {
	GetShaLike() Sha
}

type ShaReadCloser

type ShaReadCloser interface {
	io.Seeker
	io.WriterTo
	io.ReadCloser
	GetShaLike() Sha
}

TODO reconsider this and force consumption of bufio? Formats expect WriterAndStringWriter, but this forces just Writer

type ShaWriteCloser

type ShaWriteCloser interface {
	io.ReaderFrom
	io.WriteCloser
	// io.WriterAt
	GetShaLike() Sha
}

TODO reconsider this and force consumption of bufio? Formats expect WriterAndStringWriter, but this forces just Writer

type Sigil

Used primarily for limiting / restricting queries.

type SigilGetter

type SigilGetter interface {
	GetSigil() Sigil
}

type StoreVersion

type StoreVersion interface {
	Stringer
	Lessor[StoreVersion]
	GetInt() int
}

type StringAdder

type StringAdder interface {
	AddString(string) error
}

type StringFormatReadWriter

type StringFormatReadWriter[T any] interface {
	StringFormatReader[T]
	StringFormatWriter[T]
}

type StringFormatReader

type StringFormatReader[T any] interface {
	ReadStringFormat(io.Reader, T) (int64, error)
}

type StringFormatWriter

type StringFormatWriter[T any] interface {
	WriteStringFormat(WriterAndStringWriter, T) (int64, error)
}

type StringKeyer

type StringKeyer[T any] interface {
	GetKey(T) string
}

type StringKeyerPtr

type StringKeyerPtr[T any, TPtr Ptr[T]] interface {
	StringKeyer[T]
	GetKeyPtr(TPtr) string
}

type StringLenner

type StringLenner interface {
	Stringer
	Lenner
}

type StringSetterPtr

type StringSetterPtr[T any] interface {
	Stringer
	Ptr[T]
	Setter
}

type Stringer

type Stringer interface {
	String() string
}

type StringerPtr

type StringerPtr[T any] interface {
	Stringer
	Ptr[T]
}

type StringerSetter

type StringerSetter interface {
	Stringer
	Setter
}

type StringerSetterPtr

type StringerSetterPtr[T any] interface {
	Stringer
	Setter
	Ptr[T]
}

type StringerWithHeadAndTail

type StringerWithHeadAndTail interface {
	Stringer
	GetHead() string
	GetTail() string
}

type Tridex

type Tridex interface {
	TridexLike
}

type TridexLike

type TridexLike interface {
	Lenner
	EachString(FuncIter[string]) error
	ContainsAbbreviation(string) bool
	ContainsExpansion(string) bool
	Abbreviate(string) string
	Expand(string) string
}

type Value

type Value[T any] interface {
	ValueLike
	Equatable[T]
}

type ValueLike

type ValueLike interface {
	Stringer
	Element
}

type ValuePtr

type ValuePtr[T any] interface {
	ValueLike
	// Value[T]
	Ptr[T]
}

type ValuePtrLike

type ValuePtrLike interface {
	ValueLike
	Setter
}

type ValueSet

type ValueSet[T flag.Value, TPtr ValuePtr[T]] interface {
	Strings() []string
	SetLike[T]
}

type WriterAndStringWriter

type WriterAndStringWriter interface {
	io.Writer
	io.StringWriter
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL