Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

RFC-8: Add TCP protocol #8

Merged
merged 10 commits into from
Jul 17, 2021
Merged

RFC-8: Add TCP protocol #8

merged 10 commits into from
Jul 17, 2021

Conversation

bokket
Copy link
Member

@bokket bokket commented Jul 17, 2021

Signed-off-by: bokket [email protected]

Signed-off-by: bokket <[email protected]>
@bokket bokket changed the title Add Tcp Pair RFC-8:Add Tcp Pair Jul 17, 2021
Signed-off-by: bokket <[email protected]>
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-pair.md Outdated Show resolved Hide resolved
@Xuanwo Xuanwo changed the title RFC-8:Add Tcp Pair RFC-8: Add Tcp protocol Jul 17, 2021
## Implementation

- Add protocol `tcp`
- Implement protocol tcp formatted (`func (p Endpoint) Tcp() (address string)`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using TCP() as a function name instead of Tcp()? Keep the same style with HTTP() and HTTPS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And returning address string is not a good idea to me, how about returning (addr, host string, port int) instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


- Add protocol `tcp`
- Implement protocol tcp formatted (`func (p Endpoint) Tcp() (address string)`)
- Implement protocol tcp parser (`func Parse(cfg string) (Provider, error)`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Parse should return (p Endpoint, err error) instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake

- Add protocol `tcp`
- Implement protocol tcp formatted (`func (p Endpoint) Tcp() (address string)`)
- Implement protocol tcp parser (`func Parse(cfg string) (Provider, error)`)
- Implement protocol tcp object (`func NewTcp(address string) Endpoint `)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the API to NewTCP(host string, port int) Endpoint instead?

@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 17, 2021

I will approve this proposal with reviewed changes.

@Xuanwo Xuanwo changed the title RFC-8: Add Tcp protocol RFC-8: Add TCP protocol Jul 17, 2021
- RFC PR: [beyondstorage/go-endpoint#8](https://github.com/beyondstorage/go-endpoint/pull/8)
- Tracking Issue: [beyondstorage/go-endpoint/issues/9](https://github.com/beyondstorage/go-endpoint/issues/9)

# RFC-8: Add Tcp protocol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# RFC-8: Add Tcp protocol
# RFC-8: Add TCP protocol

bokket added 3 commits July 17, 2021 15:23
Signed-off-by: bokket <[email protected]>
Signed-off-by: bokket <[email protected]>
docs/rfcs/8-add-tcp-protocol.md Outdated Show resolved Hide resolved
docs/rfcs/8-add-tcp-protocol.md Outdated Show resolved Hide resolved
@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 17, 2021

Thanks for your contribution!

@Xuanwo Xuanwo merged commit b69ddae into beyondstorage:master Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants