SendSnapshot incremental stream - #59
Open
icarbajovallejo wants to merge 6 commits into
Open
Conversation
mmlb
requested changes
May 25, 2017
| ) | ||
|
|
||
| // SendFlag is the options flag passed to SendSnapshot and SendSnapshotIncremental | ||
| type SendFlag int |
| // newly-created snapshot. | ||
| func ReceiveSnapshot(input io.Reader, name string) (*Dataset, error) { | ||
| // It includes the option "-F" like boolean value. | ||
| func ReceiveSnapshot(input io.Reader, name string, overwrite bool) (*Dataset, error) { |
Member
There was a problem hiding this comment.
Changing API is a no go, with the current scheme of things you're going to have to create a new function probably something like ReceiveSnapshotOptioned (bettername++) that takes a map[string]interface{} which we can check for overwrite existence and do the right thing.
| // An error will be returned if the input dataset is not of snapshot type. | ||
| func (d *Dataset) SendSnapshot(output io.Writer) error { | ||
| // It includes the option "-R". | ||
| func (d *Dataset) SendSnapshot(output io.Writer, flags SendFlag) error { |
Member
There was a problem hiding this comment.
ditto as ^. side note: man I really wish we had a more expandable api.
Author
There was a problem hiding this comment.
I suppose it's not a super improvement. Really, I have done this changes to adapt it to my necessities. I can do more progress but more later. If you want to add more functionalities, go! Because I'm rookie in golang and I take a lot of time^^
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I modified the functions ReceiveSnapshot and SendSnapshot to include the options "-F" and "-R". As weel as I add a new function called SendSnapshotIncremental that includes the optiones "-i" and "-I" to send incremental streams of snapshots.
The option -F is a boolean value in ReceiveSnapshot function.
The options for sending snapshots are called:
-i = IncrementalStream
-I = IncrementalPackage
-R = ReplicationStream