Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("id does not exists") ErrCannotRead = errors.New("photo can't read") )
Functions ¶
This section is empty.
Types ¶
type Identifier ¶
type Identifier struct {
// contains filtered or unexported fields
}
func IdentifierOf ¶
func IdentifierOf(value string) *Identifier
func NewIdentifier ¶
func NewIdentifier(data []byte) *Identifier
func (*Identifier) Value ¶
func (id *Identifier) Value() string
Example ¶
id := IdentifierOf("example_id") fmt.Println(id.Value())
Output: example_id
type Photo ¶
type Photo struct {
// contains filtered or unexported fields
}
func Of ¶
func Of(id Identifier, data []byte) *Photo
func (*Photo) ID ¶
func (photo *Photo) ID() Identifier
type Repository ¶
type Repository interface { Save(photo Photo) (*Identifier, error) Read(id Identifier) (*Photo, error) Delete(id Identifier) error }
type ResourceError ¶
type ResourceError struct { ID Identifier Err error }
func (*ResourceError) Error ¶
func (err *ResourceError) Error() string
Click to show internal directories.
Click to hide internal directories.