database

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instantiate

func Instantiate() (storage.Storage, error)

Types

type LevelDBIterator added in v0.4.1

type LevelDBIterator[T any] struct {
	// contains filtered or unexported fields
}

LevelDBIterator is a generic implementation of Iterator for LevelDB.

func NewLevelDBIterator added in v0.4.1

func NewLevelDBIterator[T any](db *leveldb.DB, iter iterator.Iterator) *LevelDBIterator[T]

NewLevelDBIterator creates a new LevelDBIterator instance for the given LevelDB iterator and decode function.

func NewLevelDBIteratorCustomDecode added in v0.4.1

func NewLevelDBIteratorCustomDecode[T any](db *leveldb.DB, iter iterator.Iterator, decodeFunc func([]byte, interface{}) error) *LevelDBIterator[T]

NewLevelDBIterator creates a new LevelDBIterator instance for the given LevelDB iterator and decode function.

func (*LevelDBIterator[T]) Close added in v0.4.1

func (it *LevelDBIterator[T]) Close()

Close releases resources held by the underlying LevelDB iterator.

func (*LevelDBIterator[T]) DropItem added in v0.4.1

func (it *LevelDBIterator[T]) DropItem() error

DropItem deletes the key currently pointed to by the iterator.

func (*LevelDBIterator[T]) Err added in v0.4.1

func (it *LevelDBIterator[T]) Err() error

Err returns the first error encountered during iteration, if any.

func (*LevelDBIterator[T]) Item added in v0.4.1

func (it *LevelDBIterator[T]) Item() *T

Item returns the current item from the iterator. Only valid after a successful call to Next().

func (*LevelDBIterator[T]) Next added in v0.4.1

func (it *LevelDBIterator[T]) Next() bool

Next moves the iterator to the next valid item. Skips items that fail to decode and logs the error.

func (*LevelDBIterator[T]) NextWithError added in v0.4.1

func (it *LevelDBIterator[T]) NextWithError() bool

NextWithError advances the iterator to the next item, on decode error it doesn't continue to the next item. Returns true if there is a next item, false otherwise.

func (*LevelDBIterator[T]) Raw added in v0.4.1

func (it *LevelDBIterator[T]) Raw() []byte

Raw returns the raw (non-decoded) value at the current iterator position. Should only be called after a successful call to Next().

type LevelDBMigrationFunc

type LevelDBMigrationFunc func(s *LevelDBStorage) error

type LevelDBStorage

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

func NewLevelDBStorage

func NewLevelDBStorage(path string) (s *LevelDBStorage, err error)

NewMySQLStorage establishes the connection to the database

func (*LevelDBStorage) AuthUserExists

func (s *LevelDBStorage) AuthUserExists(email string) (bool, error)

func (*LevelDBStorage) ClearAuthUsers

func (s *LevelDBStorage) ClearAuthUsers() error

func (*LevelDBStorage) ClearDomains

func (s *LevelDBStorage) ClearDomains() error

func (*LevelDBStorage) ClearProviders

func (s *LevelDBStorage) ClearProviders() error

func (*LevelDBStorage) ClearSessions

func (s *LevelDBStorage) ClearSessions() error

func (*LevelDBStorage) ClearUsers

func (s *LevelDBStorage) ClearUsers() error

func (*LevelDBStorage) ClearZones

func (s *LevelDBStorage) ClearZones() error

func (*LevelDBStorage) Close

func (s *LevelDBStorage) Close() error

func (*LevelDBStorage) CreateAuthUser

func (s *LevelDBStorage) CreateAuthUser(u *happydns.UserAuth) error

func (*LevelDBStorage) CreateDomain

func (s *LevelDBStorage) CreateDomain(z *happydns.Domain) error

func (*LevelDBStorage) CreateDomainLog

func (s *LevelDBStorage) CreateDomainLog(d *happydns.Domain, l *happydns.DomainLog) error

func (*LevelDBStorage) CreateOrUpdateUser

func (s *LevelDBStorage) CreateOrUpdateUser(u *happydns.User) error

func (*LevelDBStorage) CreateProvider

func (s *LevelDBStorage) CreateProvider(prvd *happydns.Provider) error

func (*LevelDBStorage) CreateZone

func (s *LevelDBStorage) CreateZone(z *happydns.Zone) error

func (*LevelDBStorage) DeleteAuthUser

func (s *LevelDBStorage) DeleteAuthUser(u *happydns.UserAuth) error

func (*LevelDBStorage) DeleteDomain

func (s *LevelDBStorage) DeleteDomain(zId happydns.Identifier) error

func (*LevelDBStorage) DeleteDomainLog

func (s *LevelDBStorage) DeleteDomainLog(d *happydns.Domain, l *happydns.DomainLog) error

func (*LevelDBStorage) DeleteProvider

func (s *LevelDBStorage) DeleteProvider(prvdId happydns.Identifier) error

func (*LevelDBStorage) DeleteSession

func (s *LevelDBStorage) DeleteSession(id string) error

func (*LevelDBStorage) DeleteUser

func (s *LevelDBStorage) DeleteUser(uId happydns.Identifier) error

func (*LevelDBStorage) DeleteZone

func (s *LevelDBStorage) DeleteZone(id happydns.Identifier) error

func (*LevelDBStorage) GetAuthUser

func (s *LevelDBStorage) GetAuthUser(id happydns.Identifier) (u *happydns.UserAuth, err error)

func (*LevelDBStorage) GetAuthUserByEmail

func (s *LevelDBStorage) GetAuthUserByEmail(email string) (*happydns.UserAuth, error)

func (*LevelDBStorage) GetDomain

func (s *LevelDBStorage) GetDomain(id happydns.Identifier) (*happydns.Domain, error)

func (*LevelDBStorage) GetDomainByDN

func (s *LevelDBStorage) GetDomainByDN(u *happydns.User, dn string) ([]*happydns.Domain, error)

func (*LevelDBStorage) GetProvider

func (s *LevelDBStorage) GetProvider(id happydns.Identifier) (*happydns.ProviderMessage, error)

func (*LevelDBStorage) GetSession

func (s *LevelDBStorage) GetSession(id string) (session *happydns.Session, err error)

func (*LevelDBStorage) GetUser

func (s *LevelDBStorage) GetUser(id happydns.Identifier) (u *happydns.User, err error)

func (*LevelDBStorage) GetUserByEmail

func (s *LevelDBStorage) GetUserByEmail(email string) (*happydns.User, error)

func (*LevelDBStorage) GetZone

func (s *LevelDBStorage) GetZone(id happydns.Identifier) (*happydns.ZoneMessage, error)

func (*LevelDBStorage) GetZoneMeta

func (s *LevelDBStorage) GetZoneMeta(id happydns.Identifier) (z *happydns.ZoneMeta, err error)

func (*LevelDBStorage) InsightsRun

func (s *LevelDBStorage) InsightsRun() error

func (*LevelDBStorage) LastInsightsRun

func (s *LevelDBStorage) LastInsightsRun() (t *time.Time, instance happydns.Identifier, err error)

func (*LevelDBStorage) ListAllAuthUsers added in v0.4.1

func (s *LevelDBStorage) ListAllAuthUsers() (happydns.Iterator[happydns.UserAuth], error)

func (*LevelDBStorage) ListAllDomainLogs added in v0.4.1

func (s *LevelDBStorage) ListAllDomainLogs() (happydns.Iterator[happydns.DomainLogWithDomainId], error)

func (*LevelDBStorage) ListAllDomains added in v0.4.1

func (s *LevelDBStorage) ListAllDomains() (happydns.Iterator[happydns.Domain], error)

func (*LevelDBStorage) ListAllProviders added in v0.4.1

func (s *LevelDBStorage) ListAllProviders() (happydns.Iterator[happydns.ProviderMessage], error)

func (*LevelDBStorage) ListAllSessions added in v0.4.1

func (s *LevelDBStorage) ListAllSessions() (happydns.Iterator[happydns.Session], error)

func (*LevelDBStorage) ListAllUsers added in v0.4.1

func (s *LevelDBStorage) ListAllUsers() (happydns.Iterator[happydns.User], error)

func (*LevelDBStorage) ListAllZones added in v0.4.1

func (s *LevelDBStorage) ListAllZones() (happydns.Iterator[happydns.ZoneMessage], error)

func (*LevelDBStorage) ListAuthUserSessions added in v0.4.1

func (s *LevelDBStorage) ListAuthUserSessions(user *happydns.UserAuth) (sessions []*happydns.Session, err error)

func (*LevelDBStorage) ListDomainLogs added in v0.4.1

func (s *LevelDBStorage) ListDomainLogs(domain *happydns.Domain) (logs []*happydns.DomainLog, err error)

func (*LevelDBStorage) ListDomains added in v0.4.1

func (s *LevelDBStorage) ListDomains(u *happydns.User) (domains []*happydns.Domain, err error)

func (*LevelDBStorage) ListProviders

func (s *LevelDBStorage) ListProviders(u *happydns.User) (srcs happydns.ProviderMessages, err error)

func (*LevelDBStorage) ListUserSessions added in v0.4.1

func (s *LevelDBStorage) ListUserSessions(userid happydns.Identifier) (sessions []*happydns.Session, err error)

func (*LevelDBStorage) MigrateSchema added in v0.4.1

func (s *LevelDBStorage) MigrateSchema() (err error)

func (*LevelDBStorage) SchemaVersion

func (s *LevelDBStorage) SchemaVersion() int

func (*LevelDBStorage) UpdateAuthUser

func (s *LevelDBStorage) UpdateAuthUser(u *happydns.UserAuth) error

func (*LevelDBStorage) UpdateDomain

func (s *LevelDBStorage) UpdateDomain(z *happydns.Domain) error

func (*LevelDBStorage) UpdateDomainLog

func (s *LevelDBStorage) UpdateDomainLog(d *happydns.Domain, l *happydns.DomainLog) error

func (*LevelDBStorage) UpdateProvider

func (s *LevelDBStorage) UpdateProvider(prvd *happydns.Provider) error

func (*LevelDBStorage) UpdateSession

func (s *LevelDBStorage) UpdateSession(session *happydns.Session) error

func (*LevelDBStorage) UpdateZone

func (s *LevelDBStorage) UpdateZone(z *happydns.Zone) error

func (*LevelDBStorage) UserExists

func (s *LevelDBStorage) UserExists(email string) bool

type ServiceCombined

type ServiceCombined struct {
	Service map[string]interface{}
	happydns.ServiceMeta
}

type Zone

type Zone struct {
	happydns.ZoneMeta
	Services map[string][]*ServiceCombined `json:"services"`
}

Source Files

  • auth.go
  • config.go
  • database.go
  • domain-log.go
  • domain.go
  • insights.go
  • iterator.go
  • provider.go
  • session.go
  • updates-from-0.go
  • updates-from-1.go
  • updates-from-2.go
  • updates-from-3.go
  • updates-from-4.go
  • updates-from-5.go
  • updates-from-6.go
  • updates.go
  • user.go
  • zone.go

Jump to

Keyboard shortcuts

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