Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: aa3c240021
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (24 sloc) 533 Bytes
package model
type File struct {
Name string
Data []byte
func (self *File) String() string {
return self.Name
func (self *File) SetString(str string) error {
self.Name = str
return nil
func (self *File) IsEmpty() bool {
return len(self.Data) == 0
func (self *File) Required(metaData *MetaData) bool {
return metaData.BoolAttrib(StructTagKey, "required")
func (self *File) Validate(metaData *MetaData) error {
if self.Required(metaData) && self.IsEmpty() {
return NewRequiredError(metaData)
return nil
Jump to Line
Something went wrong with that request. Please try again.