Documentation ¶
Index ¶
- Constants
- func GoodSignature(p Packer) bool
- func SignPackage(p Packer)
- type BodyInterface
- type Package
- func (p *Package) ClearSecret()
- func (p *Package) GetBody() string
- func (h *Package) GetBodyType() string
- func (p *Package) GetHead() head.HeaderInterface
- func (p *Package) GetSecret() []byte
- func (p *Package) IsBodySet() bool
- func (p *Package) IsHeadSet() bool
- func (p *Package) IsPackageComplete() bool
- func (p *Package) SetBody(body string)
- func (p *Package) SetBodyMarshal(body interface{}) (err error)
- func (h *Package) SetBodyType(val string)
- func (p *Package) SetHead(head head.HeaderInterface)
- func (p *Package) SetSecret(s []byte)
- type Packer
Constants ¶
View Source
const (
PackageBodytypeError = "Error"
)
Variables ¶
This section is empty.
Functions ¶
func GoodSignature ¶
Check to see if the signature in the header is valid.
func SignPackage ¶
func SignPackage(p Packer)
SignPackage with a base64-encoded HMAC of the body contents.
Types ¶
type BodyInterface ¶
type BodyInterface interface {
Check() error
}
type Package ¶
type Package struct { System string Version float32 BodyType string Head head.HeaderInterface Body string // contains filtered or unexported fields }
Package describes what is coming from a request. It is similar to, but different from, the response package. It conforms to the Packer interface
func (*Package) ClearSecret ¶
func (p *Package) ClearSecret()
func (*Package) GetBodyType ¶
func (*Package) GetHead ¶
func (p *Package) GetHead() head.HeaderInterface
Return the HEAD of the package
func (*Package) IsHeadSet ¶
CheckHead will determine if we have all the data required for a Head in the package
func (*Package) IsPackageComplete ¶
Check to see if the package is complete
func (*Package) SetBody ¶
SetBody returns the value that is in the body. If the package is complete, it will be signed.
func (*Package) SetBodyMarshal ¶
func (*Package) SetBodyType ¶
func (*Package) SetHead ¶
func (p *Package) SetHead(head head.HeaderInterface)
SetHead will copy the head to our head, then sign the package if it is complete.
type Packer ¶
type Packer interface { SetBodyMarshal(interface{}) error SetBody(string) SetBodyType(string) SetHead(head.HeaderInterface) SetSecret([]byte) ClearSecret() GetHead() head.HeaderInterface GetBody() string GetSecret() []byte GetBodyType() string IsPackageComplete() bool IsHeadSet() bool IsBodySet() bool }
func NewPackage ¶
func NewPackage() Packer
NewPackage creates a new package and returns the address to the caller.
Click to show internal directories.
Click to hide internal directories.