Socket
Socket
Sign inDemoInstall

github.com/groob/plist

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/groob/plist


Version published

Readme

Source

OS X XML Plist library for Go

Go

The plist library is used for decoding and encoding XML Plists, usually from HTTP streams.

Example:

func someHTTPHandler(w http.ResponseWriter, r *http.Request) {
	var sparseBundleHeader struct {
		InfoDictionaryVersion *string `plist:"CFBundleInfoDictionaryVersion"`
		BandSize              *uint64 `plist:"band-size"`
		BackingStoreVersion   int     `plist:"bundle-backingstore-version"`
		DiskImageBundleType   string  `plist:"diskimage-bundle-type"`
		Size                  uint64  `plist:"unknownKey"`
	}

    // decode an HTTP request body into the sparseBundleHeader struct
	if err := plist.NewXMLDecoder(r.Body).Decode(&sparseBundleHeader); err != nil {
		log.Println(err)
        return
	}
}

Credit

This library is based of DHowett's library but has an API that's more similar to the XML and JSON libraries in the standard library. The plist.Decoder() accepts an io.Reader instead of an io.ReadSeeker

FAQs

Last updated on 17 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc