Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Option Support #8

Merged
merged 3 commits into from
Mar 31, 2021
Merged

Configurable Option Support #8

merged 3 commits into from
Mar 31, 2021

Conversation

winsock
Copy link
Contributor

@winsock winsock commented Mar 31, 2021

Context

There were hard-coded defaults and logging functions that worked fine for our internal usage but may need to be changed by others for their use case. This allows better configuration and customization to cover more use cases.

Overview

  • Add Options, InboundOptions. and OutboundOptions to allow configuring all of the options for each specific part of the connection.
  • Extract various magic values and default timeout settings into their respective option structs
  • Add in a generic logger interface type to allow outside loggers to handle the log messages
  • Add in new Dial and ListenAndServe methods that use their option structs and make the old functions call the new ones internally to maintain backwards compatibility.
  • Add in default stdout and nil loggers to be used for logging and maintaining existing outputs.

winsock added 2 commits March 22, 2021 13:55
This is to allow more configurability and user freedom when it comes to using the library. It still remains backwards compatible with the option-less API. See #7
@winsock winsock requested review from nbehary and a team March 31, 2021 15:57
@winsock winsock merged commit 8a4ed26 into v1 Mar 31, 2021
@winsock winsock deleted the options branch April 22, 2021 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants