Documentation ¶
Index ¶
- Constants
- Variables
- func GetDiskUsage(dirPath string) (string, error)
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func PlaygroundHandler(apiURL string) http.HandlerFunc
- func Server(ctx client.Context)
- type Account
- type Auction
- type AuctionBid
- type AuthorityRecord
- type Bond
- type Coin
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type KeyValue
- type KeyValueInput
- type NameRecord
- type NameRecordEntry
- type NodeInfo
- type OwnerBonds
- type PeerInfo
- type QueryResolver
- type Record
- type Reference
- type ReferenceInput
- type Resolver
- type ResolverRoot
- type Status
- type SyncInfo
- type ValidatorInfo
- type Value
- type ValueInput
Constants ¶
View Source
const BondIDAttributeName = "bondId"
BondIDAttributeName denotes the record bond ID.
View Source
const DefaultLogNumLines = 50
DefaultLogNumLines is the number of log lines to tail by default.
View Source
const ExpiryTimeAttributeName = "expiryTime"
ExpiryTimeAttributeName denotes the record expiry time.
View Source
const MaxLogNumLines = 1000
MaxLogNumLines is the max number of log lines that can be tailed.
View Source
const OwnerAttributeName = "owner"
OwnerAttributeName denotes the owner attribute name for a bond.
View Source
const RegistryVersion = "0.3.0"
RegistryVersion is the registry API version.
Variables ¶
View Source
var NodeDataPath = os.ExpandEnv("$HOME/.laconicd/data")
NodeDataPath is the path to the laconicd data folder.
Functions ¶
func GetDiskUsage ¶
GetDiskUsage returns disk usage for the given path.
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func PlaygroundHandler ¶ added in v0.7.0
func PlaygroundHandler(apiURL string) http.HandlerFunc
Types ¶
type Auction ¶
type Auction struct { ID string `json:"id"` Status string `json:"status"` OwnerAddress string `json:"ownerAddress"` CreateTime string `json:"createTime"` CommitsEndTime string `json:"commitsEndTime"` RevealsEndTime string `json:"revealsEndTime"` CommitFee *Coin `json:"commitFee"` RevealFee *Coin `json:"revealFee"` MinimumBid *Coin `json:"minimumBid"` WinnerAddress string `json:"winnerAddress"` WinnerBid *Coin `json:"winnerBid"` WinnerPrice *Coin `json:"winnerPrice"` Bids []*AuctionBid `json:"bids"` }
func GetGQLAuction ¶
func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Auction, error)
type AuctionBid ¶
type AuctionBid struct { BidderAddress string `json:"bidderAddress"` Status string `json:"status"` CommitHash string `json:"commitHash"` CommitTime string `json:"commitTime"` CommitFee *Coin `json:"commitFee"` RevealTime string `json:"revealTime"` RevealFee *Coin `json:"revealFee"` BidAmount *Coin `json:"bidAmount"` }
type AuthorityRecord ¶
type AuthorityRecord struct { OwnerAddress string `json:"ownerAddress"` OwnerPublicKey string `json:"ownerPublicKey"` Height string `json:"height"` Status string `json:"status"` BondID string `json:"bondId"` ExpiryTime string `json:"expiryTime"` Auction *Auction `json:"auction"` }
func GetGQLNameAuthorityRecord ¶
func GetGQLNameAuthorityRecord(record *registrytypes.NameAuthority) (*AuthorityRecord, error)
type ComplexityRoot ¶
type ComplexityRoot struct { Account struct { Address func(childComplexity int) int Balance func(childComplexity int) int Number func(childComplexity int) int PubKey func(childComplexity int) int Sequence func(childComplexity int) int } Auction struct { Bids func(childComplexity int) int CommitFee func(childComplexity int) int CommitsEndTime func(childComplexity int) int CreateTime func(childComplexity int) int ID func(childComplexity int) int MinimumBid func(childComplexity int) int OwnerAddress func(childComplexity int) int RevealFee func(childComplexity int) int RevealsEndTime func(childComplexity int) int Status func(childComplexity int) int WinnerAddress func(childComplexity int) int WinnerBid func(childComplexity int) int WinnerPrice func(childComplexity int) int } AuctionBid struct { BidAmount func(childComplexity int) int BidderAddress func(childComplexity int) int CommitFee func(childComplexity int) int CommitHash func(childComplexity int) int CommitTime func(childComplexity int) int RevealFee func(childComplexity int) int RevealTime func(childComplexity int) int Status func(childComplexity int) int } AuthorityRecord struct { Auction func(childComplexity int) int BondID func(childComplexity int) int ExpiryTime func(childComplexity int) int Height func(childComplexity int) int OwnerAddress func(childComplexity int) int OwnerPublicKey func(childComplexity int) int Status func(childComplexity int) int } Bond struct { Balance func(childComplexity int) int ID func(childComplexity int) int Owner func(childComplexity int) int } Coin struct { Quantity func(childComplexity int) int Type func(childComplexity int) int } KeyValue struct { Key func(childComplexity int) int Value func(childComplexity int) int } NameRecord struct { History func(childComplexity int) int Latest func(childComplexity int) int } NameRecordEntry struct { Height func(childComplexity int) int ID func(childComplexity int) int } NodeInfo struct { ID func(childComplexity int) int Moniker func(childComplexity int) int Network func(childComplexity int) int } OwnerBonds struct { Bonds func(childComplexity int) int Owner func(childComplexity int) int } PeerInfo struct { IsOutbound func(childComplexity int) int Node func(childComplexity int) int RemoteIP func(childComplexity int) int } Query struct { GetAccounts func(childComplexity int, addresses []string) int GetAuctionsByIds func(childComplexity int, ids []string) int GetBondsByIds func(childComplexity int, ids []string) int GetRecordsByIds func(childComplexity int, ids []string) int GetStatus func(childComplexity int) int LookupAuthorities func(childComplexity int, names []string) int LookupNames func(childComplexity int, names []string) int QueryBonds func(childComplexity int, attributes []*KeyValueInput) int QueryBondsByOwner func(childComplexity int, ownerAddresses []string) int QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool) int ResolveNames func(childComplexity int, names []string) int } Record struct { Attributes func(childComplexity int) int BondID func(childComplexity int) int CreateTime func(childComplexity int) int ExpiryTime func(childComplexity int) int ID func(childComplexity int) int Names func(childComplexity int) int Owners func(childComplexity int) int References func(childComplexity int) int } Reference struct { ID func(childComplexity int) int } Status struct { DiskUsage func(childComplexity int) int Node func(childComplexity int) int NumPeers func(childComplexity int) int Peers func(childComplexity int) int Sync func(childComplexity int) int Validator func(childComplexity int) int Validators func(childComplexity int) int Version func(childComplexity int) int } SyncInfo struct { CatchingUp func(childComplexity int) int LatestBlockHash func(childComplexity int) int LatestBlockHeight func(childComplexity int) int LatestBlockTime func(childComplexity int) int } ValidatorInfo struct { Address func(childComplexity int) int ProposerPriority func(childComplexity int) int VotingPower func(childComplexity int) int } Value struct { Boolean func(childComplexity int) int Float func(childComplexity int) int Int func(childComplexity int) int JSON func(childComplexity int) int Null func(childComplexity int) int Reference func(childComplexity int) int String func(childComplexity int) int Values func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type KeyValueInput ¶
type KeyValueInput struct { Key string `json:"key"` Value *ValueInput `json:"value"` }
type NameRecord ¶
type NameRecord struct { Latest *NameRecordEntry `json:"latest"` History []*NameRecordEntry `json:"history"` }
type NameRecordEntry ¶
type OwnerBonds ¶
type QueryResolver ¶
type QueryResolver interface { GetStatus(ctx context.Context) (*Status, error) GetAccounts(ctx context.Context, addresses []string) ([]*Account, error) GetBondsByIds(ctx context.Context, ids []string) ([]*Bond, error) QueryBonds(ctx context.Context, attributes []*KeyValueInput) ([]*Bond, error) QueryBondsByOwner(ctx context.Context, ownerAddresses []string) ([]*OwnerBonds, error) GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) LookupNames(ctx context.Context, names []string) ([]*NameRecord, error) ResolveNames(ctx context.Context, names []string) ([]*Record, error) GetAuctionsByIds(ctx context.Context, ids []string) ([]*Auction, error) }
type ReferenceInput ¶
type ReferenceInput struct {
ID string `json:"id"`
}
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query is the entry point to query execution.
type ResolverRoot ¶
type ResolverRoot interface {
Query() QueryResolver
}
type Status ¶
type Status struct { Version string `json:"version"` Node *NodeInfo `json:"node"` Sync *SyncInfo `json:"sync"` Validator *ValidatorInfo `json:"validator"` Validators []*ValidatorInfo `json:"validators"` NumPeers string `json:"num_peers"` Peers []*PeerInfo `json:"peers"` DiskUsage string `json:"disk_usage"` }
type ValidatorInfo ¶
type ValueInput ¶
type ValueInput struct { Null *bool `json:"null"` Int *int `json:"int"` Float *float64 `json:"float"` String *string `json:"string"` Boolean *bool `json:"boolean"` Reference *ReferenceInput `json:"reference"` Values []*ValueInput `json:"values"` }
Click to show internal directories.
Click to hide internal directories.