30 lines
618 B
Go
30 lines
618 B
Go
// Package models provides the models for the KermaGo application
|
|
package models
|
|
|
|
/*
|
|
An IEntity is an interface that represents a Kerma entity - either a Block or a Transaction
|
|
*/
|
|
type IEntity interface {
|
|
Hash() (string, error)
|
|
GetType() string
|
|
GetID() string
|
|
GetEntity() interface{}
|
|
Validate() error
|
|
String() string
|
|
}
|
|
|
|
/*
|
|
An IObject is an interface that represents a Kerma object
|
|
*/
|
|
type IObject interface {
|
|
GetObjectValue() (IEntity, error)
|
|
String() string
|
|
}
|
|
|
|
/*
|
|
A CustomMarshaler is an interface that provides custom marshaling functions
|
|
*/
|
|
type CustomMarshaler interface {
|
|
MarshalJson() ([]byte, error)
|
|
}
|