tree

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MytokenEntry

type MytokenEntry struct {
	api.MytokenEntry `json:",inline"`
	ID               mtid.MTID         `json:"-"`
	ParentID         mtid.MTID         `db:"parent_id" json:"-"`
	Name             db.NullString     `json:"name,omitempty"`
	CreatedAt        unixtime.UnixTime `db:"created" json:"created"`
	ExpiresAt        unixtime.UnixTime `db:"expires_at" json:"expires_at,omitempty"`
	MOMID            string            `db:"mom_id" json:"mom_id"`
}

MytokenEntry holds the information of a MytokenEntry as stored in the database

func AllTokensByUID added in v0.10.0

func AllTokensByUID(rlog log.Ext1FieldLogger, tx *sqlx.Tx, uid uint64) (tokens []*MytokenEntry, err error)

AllTokensByUID returns information about all mytokens for a user

func SingleTokenEntry added in v0.10.0

func SingleTokenEntry(rlog log.Ext1FieldLogger, tx *sqlx.Tx, tokenID mtid.MTID) (m MytokenEntry, err error)

SingleTokenEntry obtains the MytokenEntry for a single mytoken

func (*MytokenEntry) Root

func (ste *MytokenEntry) Root() bool

Root checks if this MytokenEntry is a root token

type MytokenEntryTree

type MytokenEntryTree struct {
	Token    *MytokenEntry       `json:"token"`
	Children []*MytokenEntryTree `json:"children,omitempty"`
}

MytokenEntryTree is a tree of MytokenEntry

func AllTokens

func AllTokens(rlog log.Ext1FieldLogger, tx *sqlx.Tx, tokenID mtid.MTID) ([]*MytokenEntryTree, error)

AllTokens returns information about all mytokens for the user linked to the passed mytoken

func TokenSubTree

func TokenSubTree(rlog log.Ext1FieldLogger, tx *sqlx.Tx, tokenID mtid.MTID) (MytokenEntryTree, error)

TokenSubTree returns information about all subtokens for the passed mytoken

Jump to

Keyboard shortcuts

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