corridors

package
v0.13.1-rc Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FromCategory = CorridorPriority(iota)
	FromTag
	FromNode
	ToCategory
	ToTag
	ToNode
	Channel
)

Variables

This section is empty.

Functions

func GetBestCorridorFlag

func GetBestCorridorFlag(key CorridorKey) int

func GetBestCorridorStatus

func GetBestCorridorStatus(key CorridorKey) bool

func RefreshCorridorCache

func RefreshCorridorCache(db *sqlx.DB) error

func RefreshCorridorCacheByType

func RefreshCorridorCacheByType(db *sqlx.DB, corridorType CorridorType) error

func RefreshCorridorCacheByTypeId

func RefreshCorridorCacheByTypeId(db *sqlx.DB, corridorTypeId int) error

func RegisterCorridorRoutes

func RegisterCorridorRoutes(r *gin.RouterGroup, db *sqlx.DB)

func RemoveCorridor

func RemoveCorridor(db *sqlx.DB, corridorId int) (int64, error)

RemoveCorridor doesn't refresh the cache!!!

Types

type Corridor

type Corridor struct {
	CorridorId     int       `json:"corridorId" db:"corridor_id"`
	CorridorTypeId int       `json:"corridorTypeId" db:"corridor_type_id"`
	ReferenceId    *int      `json:"referenceId" db:"reference_id"`
	Flag           int       `json:"flag" db:"flag"`
	Inverse        bool      `json:"inverse" db:"inverse"`
	Priority       int       `json:"priority" db:"priority"`
	FromCategoryId *int      `json:"fromCategoryId" db:"from_category_id"`
	FromTagId      *int      `json:"fromTagId" db:"from_tag_id"`
	FromNodeId     *int      `json:"fromNodeId" db:"from_node_id"`
	ChannelId      *int      `json:"channelId" db:"channel_id"`
	ToCategoryId   *int      `json:"toCategoryId" db:"to_category_id"`
	ToTagId        *int      `json:"toTagId" db:"to_tag_id"`
	ToNodeId       *int      `json:"toNodeId" db:"to_node_id"`
	CreatedOn      time.Time `json:"createdOn" db:"created_on"`
	UpdateOn       time.Time `json:"updatedOn" db:"updated_on"`
}

func AddCorridor

func AddCorridor(db *sqlx.DB, c Corridor) (*Corridor, error)

AddCorridor doesn't refresh the cache!!!

func GetBestCorridor

func GetBestCorridor(key CorridorKey) Corridor

func GetCorridorsReferencingCategory added in v0.12.0

func GetCorridorsReferencingCategory(db *sqlx.DB, categoryId int) (corridors []*Corridor, err error)

func GetCorridorsReferencingNode

func GetCorridorsReferencingNode(db *sqlx.DB, nodeId int) (corridors []*Corridor, err error)

func GetCorridorsReferencingTag

func GetCorridorsReferencingTag(db *sqlx.DB, tagId int) (corridors []*Corridor, err error)

type CorridorKey

type CorridorKey struct {
	CorridorType   CorridorType `json:"corridorType"`
	Inverse        bool         `json:"inverse"`
	ReferenceId    int          `json:"referenceId"`
	FromCategoryId int          `json:"fromCategoryId"`
	FromTagId      int          `json:"fromTagId"`
	FromNodeId     int          `json:"fromNodeId"`
	ChannelId      int          `json:"channelId"`
	ToCategoryId   int          `json:"toCategoryId"`
	ToTagId        int          `json:"toTagId"`
	ToNodeId       int          `json:"toNodeId"`
}

type CorridorPriority

type CorridorPriority int

type CorridorType

type CorridorType struct {
	CorridorTypeId int
	Label          string
	DefaultFlag    int
}

func Category added in v0.12.0

func Category() CorridorType

func Tag

func Tag() CorridorType

Jump to

Keyboard shortcuts

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