Channel
public struct Channel : ChannelDescription
A channel that can be queried for information, or be published to using an Event
.
-
The shortened channel name.
This is the channel name without the type identifier prefix, e.g.
"my-channel"
. It therefore does not expose channel type information, which can be inspected usingtype
.Declaration
Swift
public let name: String
-
The channel type.
Declaration
Swift
public let type: ChannelType
-
Creates a
Channel
based on a full name (including type prefix).The channel
type
is inferred based on the providedfullName
. e.g. AfullName
of"private-my-channel"
results in a channel whosename
is"my-channel"
and atype
ofprivate
.If a shortened name is accidentally used, this results in a channel of
type
public
since no type prefix was provided.Declaration
Swift
public init(fullName: String)
Parameters
fullName
The full channel name.
-
Creates a
Channel
based on a shortened name and a channel type.If a full name is accidentally used, this results in a channel whose type is determined by the
type
parameter, regardless of any type prefix that is present in the name string.Declaration
Swift
public init(name: String, type: ChannelType)
Parameters
name
The shortened channel name.
type
The channel type.