Documentation

Index

Constants

This section is empty.

Variables

View Source
var BoundarySize int

    BoundarySize will contain the size of the complete boundary pattern

    Functions

    func IsBoundary

    func IsBoundary(data []byte) bool

      IsBoundary checks if the given byte slice equals the boundary.

      func SeekBoundary

      func SeekBoundary(in io.ReadSeeker) int64

        SeekBoundary reads from the reader until the end of the boundary. Returns the number of bytes (offset) that were read (including the pattern itself). Returns -1 if the boundary was not found.

        func SeekPattern

        func SeekPattern(in io.ReadSeeker, pattern []byte) int64

          SeekPattern reads from the reader until the search pattern was found. The next byte coming from the reader will be the first byte after the pattern ended. Returns the number of bytes (offset) that were read (including the pattern itself). Returns -1 if the pattern was not found.

          func WriteBoundary

          func WriteBoundary(w io.Writer) error

            WriteBoundary writes a new section with arbitrary data.

            Types

            type Attachment

            type Attachment struct {
            	Name string // Resource name
            	Size int64  // Resource size in bytes
            }

              Attachment represents a single embedded resource.

              type TOC

              type TOC []Attachment

                TOC (=table of content) lists all attachments of an executable. The order of attachments in the TOC reflects the order of attachment data afterwards. The TOC is embedded as json prior to the first attachment, guarded by a boundary byte-pattern on both sides.

                Source Files