<commit_before># horsefeather

[![GoDoc](https://godoc.org/github.com/SeanDolphin/horsefeather?status.png)](http://godoc.org/github.com/SeanDolphin/horsefeather)  
[![Build Status](https://travis-ci.org/SeanDolphin/horsefeather.svg?branch=master)](https://travis-ci.org/SeanDolphin/horsefeather)  
[![Coverage Status](https://coveralls.io/repos/SeanDolphin/horsefeather/badge.svg)](https://coveralls.io/r/SeanDolphin/horsefeather)  
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

horsefeather is a [Google Appengine Engine](https://github.com/golang/appengine) extension that adds functionality through tags to handle saving and loading datastore models differently.

**Usage**

~~~ go
package somepackage

import (
	"github.com/SeanDolphin/horsefeather"
	"google.golang.org/appengine/datastore"

	"time"
)

type Person struct{
	Key    		*datastore.Key
	Name 		FullName 		`datastore:"-" hf:"opaque"`			//saves this property as a json string
	Address    	*Address  		`datastore:"-" hf:"compress,crc"`	//compresses this property and calculates and crc
	AddressCRC	string			`datastore:",noindex"`				//set by horsefeather crc above
	Updated 	time.TIme 		`hf:"timestamp"`					//updated on save with current timestamp
}

func (person *Content) Load(input []datastore.Property) error {
	return horsefeather.LoadStruct(person, input)
}

func (person *Content) Save() ([]datastore.Property, error) {
	return horsefeather.SaveStruct(person)
}

type FullName struct{
	First	string
	Last 	string
}

type Address struct {
	Street  string
	City    string<commit_msg>updated to point to gopkg.in<commit_after># horsefeather

[![GoDoc](https://godoc.org/github.com/SeanDolphin/horsefeather?status.png)](http://godoc.org/github.com/SeanDolphin/horsefeather)  
[![Build Status](https://travis-ci.org/SeanDolphin/horsefeather.svg?branch=master)](https://travis-ci.org/SeanDolphin/horsefeather)  
[![Coverage Status](https://coveralls.io/repos/SeanDolphin/horsefeather/badge.svg)](https://coveralls.io/r/SeanDolphin/horsefeather)  
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

horsefeather is a [Google Appengine Engine](https://github.com/golang/appengine) extension that adds functionality through tags to handle saving and loading datastore models differently.

## Installation

The import path for the package is *gopkg.in/SeanDolphin/horsefeather.v1*.

To install it, run:

    go get gopkg.in/SeanDolphin/horsefeather.v1

**Usage**

~~~ go
package somepackage

import (
	"gopkg.in/SeanDolphin/horsefeather.v1"
	"google.golang.org/appengine/datastore"

	"time"
)

type Person struct{
	Key    		*datastore.Key
	Name 		FullName 		`datastore:"-" hf:"opaque"`			//saves this property as a json string
	Address    	*Address  		`datastore:"-" hf:"compress,crc"`	//compresses this property and calculates and crc
	AddressCRC	string			`datastore:",noindex"`				//set by horsefeather crc above
	Updated 	time.TIme 		`hf:"timestamp"`					//updated on save with current timestamp
}

func (person *Content) Load(input []datastore.Property) error {
	return horsefeather.LoadStruct(person, input)
}

func (person *Content) Save() ([]datastore.Property, error) {
	return horsefeather.SaveStruct(person)
}

type FullName struct{
	First	string
	Last 	string
}

type Address struct {
	Street  string
	City    string
{'fraction_non_alphanumeric': 0.13448578962789334, 'fraction_numerical': 0.0020509815411661296, 'mean_word_length': 4.796264855687606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3966302', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1171, 'n_words': 241}