fileitem

package module
v0.0.0-...-7a072e4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 6 Imported by: 0

README

fileitem

A Go library, that implements small container, linked to a text file

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileItem

type FileItem struct {
	// contains filtered or unexported fields
}

FileItem is a structure, that allows you to store items either in the text file and this structure memory.

func New

func New(path string) (*FileItem, error)

New creates new FileItem instance.

func (*FileItem) Add

func (fi *FileItem) Add(item string) error

Add tries to add item to FileItem memory and sync with file.

func (*FileItem) Contains

func (fi *FileItem) Contains(item string) bool

Contains returns true, if FileItem has this item in memory. It compares two strings by strings.EqualFold method.

func (*FileItem) Items

func (fi *FileItem) Items() iter.Seq[string]

Items returns the iterator of items.

func (*FileItem) Remove

func (fi *FileItem) Remove(item string) error

Remove tries to remove the item from FileItem memory.

Jump to

Keyboard shortcuts

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