Documentation
¶
Index ¶
- Constants
- type Block
- func (o *Block) Data() string
- func (o *Block) PreviousHash() string
- func (o *Block) SetData(data string) *Block
- func (o *Block) SetPreviousHash(previousHash string) *Block
- func (o *Block) SetThisHash(thisHash string) *Block
- func (o *Block) SetTimestamp(timestamp string) *Block
- func (o *Block) ThisHash() string
- func (o *Block) Timestamp() string
- type BlockQueryOptions
- type Blockchain
- type NewStoreOptions
- type Store
- func (store *Store) AutoMigrate() error
- func (store *Store) BlockCreate(ctx context.Context, block *Block) error
- func (store *Store) BlockDelete(ctx context.Context, block *Block) error
- func (store *Store) BlockDeleteByID(ctx context.Context, id string) error
- func (store *Store) BlockFindByID(ctx context.Context, id string) (*Block, error)
- func (store *Store) BlockList(ctx context.Context, options BlockQueryOptions) ([]Block, error)
- func (store *Store) BlockUpdate(ctx context.Context, block *Block) error
- func (st *Store) EnableDebug(debug bool)
- type StoreInterface
Constants ¶
View Source
const BLOCK_TABLE_NAME = "blocks_block"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
dataobject.DataObject
}
func NewBlockFromJSON ¶
func (*Block) PreviousHash ¶
func (*Block) SetPreviousHash ¶
func (*Block) SetThisHash ¶
func (*Block) SetTimestamp ¶
type BlockQueryOptions ¶
type Blockchain ¶
type Blockchain struct {
dataobject.DataObject
}
func NewBlockchain ¶
func NewBlockchain() *Blockchain
type NewStoreOptions ¶
type NewStoreOptions struct {
BlockTableName string
DB *sql.DB
DbDriverName string
TimeoutSeconds int64
AutomigrateEnabled bool
DebugEnabled bool
}
NewStoreOptions define the options for creating a new block store
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (*Store, error)
NewStore creates a new block store
func (*Store) BlockCreate ¶
func (*Store) BlockDelete ¶
func (*Store) BlockDeleteByID ¶
func (*Store) BlockFindByID ¶
func (*Store) BlockUpdate ¶
func (*Store) EnableDebug ¶
EnableDebug - enables the debug option
type StoreInterface ¶
type StoreInterface interface {
BlockCreate(ctx context.Context, block *Block) error
BlockDelete(ctx context.Context, block *Block) error
BlockDeleteByID(ctx context.Context, blockID string) error
BlockFindByID(ctx context.Context, id string) (*Block, error)
BlockList(ctx context.Context, options BlockQueryOptions) ([]Block, error)
BlockUpdate(ctx context.Context, block *Block) error
}
Click to show internal directories.
Click to hide internal directories.