Documentation ¶
Index ¶
- func Update(db *bolt.DB, f func(*Root) error) error
- func View(db *bolt.DB, f func(*Root) error) error
- type Agent
- func (o *Agent) Bucket() *bolt.Bucket
- func (o *Agent) Channels() *MapOfFsmChannel
- func (o *Agent) Config() *Config
- func (o *Agent) EncryptedSeed() []byte
- func (o *Agent) Messages() *MapOfMessageMessage
- func (o *Agent) NextKeypathIndex() uint32
- func (o *Agent) PrimaryAcct() *fsm.AccountID
- func (o *Agent) PutEncryptedSeed(v []byte)
- func (o *Agent) PutNextKeypathIndex(v uint32)
- func (o *Agent) PutPrimaryAcct(v *fsm.AccountID)
- func (o *Agent) PutReady(v bool)
- func (o *Agent) PutWallet(v *fsm.WalletAcct)
- func (o *Agent) Ready() bool
- func (o *Agent) Updates() *SeqOfUpdateUpdate
- func (o *Agent) Wallet() *fsm.WalletAcct
- type Config
- func (o *Config) Bucket() *bolt.Bucket
- func (o *Config) ChannelFeerate() int64
- func (o *Config) FinalityDelayMins() int64
- func (o *Config) HorizonURL() string
- func (o *Config) HostFeerate() int64
- func (o *Config) KeepAlive() bool
- func (o *Config) MaxRoundDurMins() int64
- func (o *Config) Public() bool
- func (o *Config) PutChannelFeerate(v int64)
- func (o *Config) PutFinalityDelayMins(v int64)
- func (o *Config) PutHorizonURL(v string)
- func (o *Config) PutHostFeerate(v int64)
- func (o *Config) PutKeepAlive(v bool)
- func (o *Config) PutMaxRoundDurMins(v int64)
- func (o *Config) PutPublic(v bool)
- func (o *Config) PutPwHash(v []byte)
- func (o *Config) PutPwType(v string)
- func (o *Config) PutUsername(v string)
- func (o *Config) PwHash() []byte
- func (o *Config) PwType() string
- func (o *Config) Username() string
- type MapOfFsmChannel
- type MapOfMessageMessage
- func (o *MapOfMessageMessage) Bucket() *bolt.Bucket
- func (o *MapOfMessageMessage) Get(key []byte) *message.Message
- func (o *MapOfMessageMessage) GetByString(key string) *message.Message
- func (o *MapOfMessageMessage) Put(key []byte, v *message.Message)
- func (o *MapOfMessageMessage) PutByString(key string, v *message.Message)
- type Root
- type SeqOfUpdateUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a bucket with a static set of elements.
Agent is the db layout for a Starlight agent.
Accessor methods read and write records and open child buckets.
func (*Agent) Bucket ¶
Bucket returns o's underlying *bolt.Bucket object. This can be useful to access low-level database functions or other features not exposed by this generated code.
Note, if o's transaction is read-only and the underlying bucket has not previously been created in a writable transaction, Bucket returns nil.
func (*Agent) Channels ¶
func (o *Agent) Channels() *MapOfFsmChannel
Channels gets the child bucket with key "Channels" from o.
Channels holds the state of all open channels. Closed channels are deleted. (Their history is still available in Updates.)
Channels creates a new bucket if none exists and o's transaction is writable. Regardless, it always returns a non-nil *MapOfFsmChannel; if the bucket doesn't exist and o's transaction is read-only, the returned value represents an empty bucket.
func (*Agent) Config ¶
Config gets the child bucket with key "Config" from o.
Config creates a new bucket if none exists and o's transaction is writable. Regardless, it always returns a non-nil *Config; if the bucket doesn't exist and o's transaction is read-only, the returned value represents an empty bucket.
func (*Agent) EncryptedSeed ¶
EncryptedSeed reads the record stored under key "EncryptedSeed". If no record has been stored, EncryptedSeed returns the zero value.
func (*Agent) Messages ¶
func (o *Agent) Messages() *MapOfMessageMessage
Messages gets the child bucket with key "Messages" from o.
Messages creates a new bucket if none exists and o's transaction is writable. Regardless, it always returns a non-nil *MapOfMessageMessage; if the bucket doesn't exist and o's transaction is read-only, the returned value represents an empty bucket.
func (*Agent) NextKeypathIndex ¶
NextKeypathIndex reads the record stored under key "NextKeypathIndex". If no record has been stored, NextKeypathIndex returns the zero value.
func (*Agent) PrimaryAcct ¶
PrimaryAcct reads the record stored under key "PrimaryAcct". If no record has been stored, PrimaryAcct returns a pointer to the zero value.
func (*Agent) PutEncryptedSeed ¶
PutEncryptedSeed stores v as a record under the key "EncryptedSeed".
func (*Agent) PutNextKeypathIndex ¶
PutNextKeypathIndex stores v as a record under the key "NextKeypathIndex".
func (*Agent) PutPrimaryAcct ¶
PutPrimaryAcct stores v as a record under the key "PrimaryAcct".
func (*Agent) PutReady ¶
PutReady stores v as a record under the key "Ready".
Ready indicates whether or not the Agent is ready to accept and process new commands. The Agent is only in a not-ready state when it is closing.
func (*Agent) PutWallet ¶
func (o *Agent) PutWallet(v *fsm.WalletAcct)
PutWallet stores v as a record under the key "Wallet".
func (*Agent) Ready ¶
Ready reads the record stored under key "Ready".
Ready indicates whether or not the Agent is ready to accept and process new commands. The Agent is only in a not-ready state when it is closing.
If no record has been stored, Ready returns the zero value.
func (*Agent) Updates ¶
func (o *Agent) Updates() *SeqOfUpdateUpdate
Updates gets the child bucket with key "Updates" from o.
Updates creates a new bucket if none exists and o's transaction is writable. Regardless, it always returns a non-nil *SeqOfUpdateUpdate; if the bucket doesn't exist and o's transaction is read-only, the returned value represents an empty bucket.
func (*Agent) Wallet ¶
func (o *Agent) Wallet() *fsm.WalletAcct
Wallet reads the record stored under key "Wallet". If no record has been stored, Wallet returns a pointer to the zero value.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a bucket with a static set of elements.
Config is the db layout for Starlight agent-level configuration.
Accessor methods read and write records and open child buckets.
func (*Config) Bucket ¶
Bucket returns o's underlying *bolt.Bucket object. This can be useful to access low-level database functions or other features not exposed by this generated code.
Note, if o's transaction is read-only and the underlying bucket has not previously been created in a writable transaction, Bucket returns nil.
func (*Config) ChannelFeerate ¶
ChannelFeerate reads the record stored under key "ChannelFeerate". If no record has been stored, ChannelFeerate returns the zero value.
func (*Config) FinalityDelayMins ¶
FinalityDelayMins reads the record stored under key "FinalityDelayMins". If no record has been stored, FinalityDelayMins returns the zero value.
func (*Config) HorizonURL ¶
HorizonURL reads the record stored under key "HorizonURL". If no record has been stored, HorizonURL returns the zero value.
func (*Config) HostFeerate ¶
HostFeerate reads the record stored under key "HostFeerate". If no record has been stored, HostFeerate returns the zero value.
func (*Config) KeepAlive ¶
KeepAlive reads the record stored under key "KeepAlive". If no record has been stored, KeepAlive returns the zero value.
func (*Config) MaxRoundDurMins ¶
MaxRoundDurMins reads the record stored under key "MaxRoundDurMins". If no record has been stored, MaxRoundDurMins returns the zero value.
func (*Config) Public ¶
Public reads the record stored under key "Public". If no record has been stored, Public returns the zero value.
func (*Config) PutChannelFeerate ¶
PutChannelFeerate stores v as a record under the key "ChannelFeerate".
func (*Config) PutFinalityDelayMins ¶
PutFinalityDelayMins stores v as a record under the key "FinalityDelayMins".
func (*Config) PutHorizonURL ¶
PutHorizonURL stores v as a record under the key "HorizonURL".
func (*Config) PutHostFeerate ¶
PutHostFeerate stores v as a record under the key "HostFeerate".
func (*Config) PutKeepAlive ¶
PutKeepAlive stores v as a record under the key "KeepAlive".
func (*Config) PutMaxRoundDurMins ¶
PutMaxRoundDurMins stores v as a record under the key "MaxRoundDurMins".
func (*Config) PutPwType ¶
PutPwType stores v as a record under the key "PwType".
PwType records which hashing function was used for PwHash. Currently, it's always "bcrypt".
func (*Config) PutUsername ¶
PutUsername stores v as a record under the key "Username".
func (*Config) PwHash ¶
PwHash reads the record stored under key "PwHash". If no record has been stored, PwHash returns the zero value.
type MapOfFsmChannel ¶
type MapOfFsmChannel struct {
// contains filtered or unexported fields
}
MapOfFsmChannel is a bucket with arbitrary keys, holding records of type *fsm.Channel.
func (*MapOfFsmChannel) Bucket ¶
func (o *MapOfFsmChannel) Bucket() *bolt.Bucket
Bucket returns o's underlying *bolt.Bucket object. This can be useful to access low-level database functions or other features not exposed by this generated code.
Note, if o's transaction is read-only and the underlying bucket has not previously been created in a writable transaction, Bucket returns nil.
func (*MapOfFsmChannel) Get ¶
func (o *MapOfFsmChannel) Get(key []byte) *fsm.Channel
Get reads the record stored in o under the given key.
If no record has been stored, it returns a pointer to the zero value.
func (*MapOfFsmChannel) GetByString ¶
func (o *MapOfFsmChannel) GetByString(key string) *fsm.Channel
GetByString is equivalent to o.Get([]byte(key)).
func (*MapOfFsmChannel) Put ¶
func (o *MapOfFsmChannel) Put(key []byte, v *fsm.Channel)
Put stores v in o as a record under the given key.
func (*MapOfFsmChannel) PutByString ¶
func (o *MapOfFsmChannel) PutByString(key string, v *fsm.Channel)
PutByString is equivalent to o.Put([]byte(key), v).
type MapOfMessageMessage ¶
type MapOfMessageMessage struct {
// contains filtered or unexported fields
}
MapOfMessageMessage is a bucket with arbitrary keys, holding records of type *message.Message.
func (*MapOfMessageMessage) Bucket ¶
func (o *MapOfMessageMessage) Bucket() *bolt.Bucket
Bucket returns o's underlying *bolt.Bucket object. This can be useful to access low-level database functions or other features not exposed by this generated code.
Note, if o's transaction is read-only and the underlying bucket has not previously been created in a writable transaction, Bucket returns nil.
func (*MapOfMessageMessage) Get ¶
func (o *MapOfMessageMessage) Get(key []byte) *message.Message
Get reads the record stored in o under the given key.
If no record has been stored, it returns a pointer to the zero value.
func (*MapOfMessageMessage) GetByString ¶
func (o *MapOfMessageMessage) GetByString(key string) *message.Message
GetByString is equivalent to o.Get([]byte(key)).
func (*MapOfMessageMessage) Put ¶
func (o *MapOfMessageMessage) Put(key []byte, v *message.Message)
Put stores v in o as a record under the given key.
func (*MapOfMessageMessage) PutByString ¶
func (o *MapOfMessageMessage) PutByString(key string, v *message.Message)
PutByString is equivalent to o.Put([]byte(key), v).
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root is a bucket with a static set of elements.
Root is the type of the root bucket, as required by genbolt.
Accessor methods read and write records and open child buckets. See functions View and Update to open transactions.
func NewRoot ¶
NewRoot returns a new Root for tx.
Root is the type of the root bucket, as required by genbolt.
func (*Root) Agent ¶
Agent gets the child bucket with key "Agent" from o.
Agent creates a new bucket if none exists and o's transaction is writable. Regardless, it always returns a non-nil *Agent; if the bucket doesn't exist and o's transaction is read-only, the returned value represents an empty bucket.
func (*Root) DeleteAgent ¶
func (r *Root) DeleteAgent()
DeleteAgent wipes an agent from the database by deleting its bucket.
type SeqOfUpdateUpdate ¶
type SeqOfUpdateUpdate struct {
// contains filtered or unexported fields
}
SeqOfUpdateUpdate is a bucket with sequential numeric keys, holding records of type *update.Update.
func (*SeqOfUpdateUpdate) Add ¶
func (o *SeqOfUpdateUpdate) Add(v *update.Update, np *uint64)
Add stores v in o under a new sequence number. It writes the new sequence number to *np before marshaling v. It is okay for np to point to a field inside v, to store the sequence number in the new record.
func (*SeqOfUpdateUpdate) Bucket ¶
func (o *SeqOfUpdateUpdate) Bucket() *bolt.Bucket
Bucket returns o's underlying *bolt.Bucket object. This can be useful to access low-level database functions or other features not exposed by this generated code.
Note, if o's transaction is read-only and the underlying bucket has not previously been created in a writable transaction, Bucket returns nil.