corridors

package
v0.10.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FromTag = CorridorPriority(iota)
	FromNode
	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"`
	FromTagId      *int      `json:"fromTagId" db:"from_tag_id"`
	FromNodeId     *int      `json:"fromNodeId" db:"from_node_id"`
	ChannelId      *int      `json:"channelId" db:"channel_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 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"`
	FromTagId    int          `json:"fromTagId"`
	FromNodeId   int          `json:"fromNodeId"`
	ChannelId    int          `json:"channelId"`
	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 AutoFee

func AutoFee() CorridorType

func Tag

func Tag() CorridorType

Jump to

Keyboard shortcuts

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