Documentation ¶
Index ¶
- func ClearChannelForURN(ctx context.Context, db *sqlx.DB, interchange *Interchange, urn string) error
- func SetChannelForURN(ctx context.Context, db *sqlx.DB, interchange *Interchange, channel *Channel, ...) error
- func UpdateInterchangeConfig(ctx context.Context, db *sqlx.DB, interchanges []*Interchange) (err error)
- type Channel
- type Interchange
- type URNMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearChannelForURN ¶ added in v0.1.6
func ClearChannelForURN(ctx context.Context, db *sqlx.DB, interchange *Interchange, urn string) error
ClearChannelForURN clears any association with a channel a URN has
func SetChannelForURN ¶
func SetChannelForURN(ctx context.Context, db *sqlx.DB, interchange *Interchange, channel *Channel, urn string) error
SetChannelForURN associates the passed in URN with the passed in Channel
func UpdateInterchangeConfig ¶
func UpdateInterchangeConfig(ctx context.Context, db *sqlx.DB, interchanges []*Interchange) (err error)
UpdateInterchangeConfig updates our interchange configs according to the passed in interchanges. Returns any errors encountered during validation or writing to the db.
Types ¶
type Channel ¶
type Channel struct { UUID string `db:"uuid" json:"uuid" validate:"required,uuid4"` Name string `db:"name" json:"name" validate:"required"` InterchangeUUID string `db:"interchange_uuid" json:"-"` URL string `db:"url" json:"url" validate:"required,url"` Keywords pq.StringArray `db:"keywords" json:"keywords"` }
Channel represents our channels
func GetChannelForURN ¶
func GetChannelForURN(ctx context.Context, db *sqlx.DB, interchange *Interchange, urn string) (*Channel, error)
GetChannelForURN returns the channel that is associated with the passed in URN, if any
type Interchange ¶
type Interchange struct { UUID string `db:"uuid" json:"uuid" validate:"required,uuid4"` Name string `db:"name" json:"name" validate:"required"` Country string `db:"country" json:"country" validate:"required"` Scheme string `db:"scheme" json:"scheme" validate:"required"` DefaultChannelUUID string `db:"default_channel_uuid" json:"-"` Channels []Channel ` json:"channels" validate:"required,dive"` // contains filtered or unexported fields }
Interchange represents our interchanges
func GetInterchange ¶
GetInterchange returns the interchange configuration for the passed in UUID. This will include the channels for the interchange with the default channel being the first channel in the slice.
func GetInterchangeConfig ¶
GetInterchangeConfig returns our complete interchange configuration
type URNMapping ¶
type URNMapping struct { URN string `db:"urn" json:"urn"` InterchangeUUID string `db:"interchange_uuid" json:"interchange_uuid"` ChannelUUID string `db:"channel_uuid" json:"channel_uuid"` }
URNMapping represents the mapping for a URN