tags

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTagRoutes

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

func TagEntity added in v0.16.9

func TagEntity(db *sqlx.DB, req TagEntityRequest) (err error)

tagEntity adds a tag to a node or channel

func UntagEntity added in v0.16.9

func UntagEntity(db *sqlx.DB, req TagEntityRequest) (err error)

Types

type ChannelTagsRequest added in v0.16.2

type ChannelTagsRequest struct {
	ChannelId int  `db:"channel_id"`
	NodeId    *int `db:"node_id"`
}

type NodeTagsRequest added in v0.16.2

type NodeTagsRequest struct {
	NodeId int `db:"node_id"`
}

type Tag added in v0.10.0

type Tag struct {
	TagId         int       `json:"tagId" db:"tag_id"`
	Name          string    `json:"name" db:"name"`
	Style         string    `json:"style" db:"style"`
	CategoryId    *int      `json:"categoryId" db:"category_id"`
	CategoryName  *string   `json:"categoryName" db:"category_name"`
	CategoryStyle *string   `json:"categoryStyle" db:"category_style"`
	CreatedOn     time.Time `json:"createdOn" db:"created_on"`
	UpdateOn      time.Time `json:"updatedOn" db:"updated_on"`
}

func GetChannelTags added in v0.16.2

func GetChannelTags(db *sqlx.DB, req ChannelTagsRequest) ([]Tag, error)

GetChannelTags gets the tags for a channel, if both the channel id and node id is set it will also return the tags for the node

func GetNodeTags added in v0.16.2

func GetNodeTags(db *sqlx.DB, nodeId int) ([]Tag, error)

Get the tags for a node

type TagEntityRequest added in v0.16.2

type TagEntityRequest struct {
	TagId     int  `db:"tag_id"`
	ChannelId *int `db:"channel_id"`
	NodeId    *int `db:"node_id"`
}

type TagResponse added in v0.16.2

type TagResponse struct {
	Tag
	Channels []TaggedChannels `json:"channels"`
	Nodes    []TaggedNodes    `json:"nodes"`
}

func GetTag added in v0.10.0

func GetTag(db *sqlx.DB, tagId int) (TagResponse, error)

func GetTags added in v0.10.0

func GetTags(db *sqlx.DB) ([]TagResponse, error)

func GetTagsByCategoryId added in v0.12.0

func GetTagsByCategoryId(db *sqlx.DB, categoryId int) ([]TagResponse, error)

type TaggedChannels added in v0.16.2

type TaggedChannels struct {
	Name           *string `db:"name" json:"name"`
	ShortChannelId string  `db:"short_channel_id" json:"shortChannelId"`
	ChannelId      int     `db:"channel_id" json:"channelId"`
}

type TaggedNodes added in v0.16.2

type TaggedNodes struct {
	Name         *string `db:"name" json:"name"`
	NodeId       int     `db:"node_id" json:"nodeId"`
	ChannelCount int     `db:"channel_count" json:"channelCount"`
}

Jump to

Keyboard shortcuts

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