channel

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel string

Channel represents a websocket stream channel

const (
	// ErrorChannel handles all the errors that happens inside the server.
	ErrorChannel Channel = "error"
)

func RegisterPrivateChannel

func RegisterPrivateChannel(channelStr string) Channel

RegisterPrivateChannel registers a new private channel. It converts the input string to the Channel type and adds it to the supportedChannels a supportedPrivateChannels maps.

RegisterPrivateChannel is thread safe and client can use it in multiple goroutines.

Client should call this function in application startup to register the private channels.

func RegisterPrivateChannels

func RegisterPrivateChannels(channels ...string) []Channel

RegisterPrivateChannels registers a list of private channels. It is thread safe.

func RegisterPublicChannel

func RegisterPublicChannel(channelStr string) Channel

RegisterPublicChannel registers a new public channel. It converts the input string to the Channel type and adds it to the supportedChannels a supportedPublicChannels maps.

RegisterPublicChannel is thread safe and client can use it in multiple goroutines.

Client should call this function in application startup to register the public channels.

func RegisterPublicChannels

func RegisterPublicChannels(channels ...string) []Channel

RegisterPublicChannels registers a list of public channels. It is thread safe.

func (Channel) IsSupportedChannel

func (c Channel) IsSupportedChannel() bool

IsSupportedChannel checks if the channel value is valid or not. It is trade-safe.

func (Channel) IsSupportedPrivateChannel

func (c Channel) IsSupportedPrivateChannel() bool

IsSupportedPrivateChannel checks if the channel value is a valid private channel or not. It is trade-safe.

func (Channel) IsSupportedPublicChannel

func (c Channel) IsSupportedPublicChannel() bool

IsSupportedPublicChannel checks if the channel value is a valid public channel or not. It is trade-safe.

func (Channel) String

func (c Channel) String() string

Jump to

Keyboard shortcuts

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