Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovedUsers ¶
type ApprovedUsers struct {
// contains filtered or unexported fields
}
ApprovedUsers is a storage for approved users ids, not thread-safe.
Clients should not reuse ApprovedUsers for multiple goroutines, create a new instance instead. Even if access to Store and Read is synchronized, the underlying file is not.
func NewApprovedUsers ¶
func NewApprovedUsers(filePath string) *ApprovedUsers
NewApprovedUsers creates a new ApprovedUsers storage
func (*ApprovedUsers) Read ¶
func (au *ApprovedUsers) Read(p []byte) (n int, err error)
Read reads ids from the storage Each read returns one id, followed by a newline
func (*ApprovedUsers) Store ¶
func (au *ApprovedUsers) Store(ids []string) error
Store saves ids to the storage, overwriting the existing content data is stored in little endian, binary format. 8 bytes for each id.
Click to show internal directories.
Click to hide internal directories.