We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should write a DCC encoder as a method of the DCC struct.
DCC
func (d *DCC) Encode(w io.Writer) error { /* ... */ }
This should fully marshal our DCC struct to a byte slice, by writing the bytes sequentially into the given stream.
The use-case, as a user of this library, looks something like this:
import ( "bufio" "ioutil" "os" dcc "github.com/gravestench/dcc/pkg" ) func main() { // load a dcc file fileContents, err := ioutil.ReadFile("/path/to/something.dcc") if err != nil { // file io error } // parse the dcc file data into a dcc struct instance, err := dcc.FromBytes(fileContents) if err != nil { // dcc parse error } // re-encode the struct back to dcc data, should be identical to original file data f, err := os.Create("/path/to/something_else.dcc") if err != nil { // file io error } defer f.Close() stream := bufio.NewWriter(w) if err := instance.Encode(stream); err != nil { // dcc encode error } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should write a DCC encoder as a method of the
DCC
struct.This should fully marshal our DCC struct to a byte slice, by writing the bytes sequentially into the given stream.
The use-case, as a user of this library, looks something like this:
The text was updated successfully, but these errors were encountered: