refactor: Remove "Opts" abbreviation (#92)

Having a mixture of abbreviations in the codebase reduces
clarity. Although opts is common for options, I'd rather
set a precedent of clarifying verbosity.
This commit is contained in:
Kyle Carberry
2022-01-29 19:27:44 -06:00
committed by GitHub
parent f9e594fbad
commit 3e88f1502a
5 changed files with 26 additions and 26 deletions

View File

@ -27,7 +27,7 @@ const (
// The initialization overrides listener handles, and detaches
// the channel on open. The datachannel should not be manually
// mutated after being passed to this function.
func newChannel(conn *Conn, dc *webrtc.DataChannel, opts *ChannelOpts) *Channel {
func newChannel(conn *Conn, dc *webrtc.DataChannel, opts *ChannelOptions) *Channel {
channel := &Channel{
opts: opts,
conn: conn,
@ -41,7 +41,7 @@ func newChannel(conn *Conn, dc *webrtc.DataChannel, opts *ChannelOpts) *Channel
return channel
}
type ChannelOpts struct {
type ChannelOptions struct {
// ID is a channel ID that should be used when `Negotiated`
// is true.
ID uint16
@ -72,7 +72,7 @@ type ChannelOpts struct {
// WebRTC PeerConnection failure. This is done to emulate TCP connections.
// This option can be changed in the options when creating a Channel.
type Channel struct {
opts *ChannelOpts
opts *ChannelOptions
conn *Conn
dc *webrtc.DataChannel