Documentation
¶
Index ¶
- Constants
- Variables
- func GetDiskUsage(dirPath string) (string, error)
- func GetLogs(ctx context.Context, logFile string, count *int) ([]string, error)
- func MatchOnAttributes(record *nameservice.Record, attributes []*KeyValueInput, all bool) bool
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func Server(baseApp *bam.BaseApp, cdc *codec.Codec, keeper nameservice.Keeper, ...)
- type Account
- type AuthorityRecord
- type AuthorityResult
- type Bond
- type Coin
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type KeyValue
- type KeyValueInput
- type MutationResolver
- type NameRecord
- type NameRecordEntry
- type NameResult
- type NodeInfo
- type PeerInfo
- type QueryResolver
- type Record
- type RecordResult
- type Reference
- type ReferenceInput
- type Resolver
- type ResolverRoot
- type ResultMeta
- type Status
- type SyncInfo
- type ValidatorInfo
- type Value
- type ValueInput
Constants ¶
const BondIDAttributeName = "bondId"
BondIDAttributeName denotes the record bond ID.
const DefaultLogNumLines = 50
DefaultLogNumLines is the number of log lines to tail by default.
const ExpiryTimeAttributeName = "expiryTime"
ExpiryTimeAttributeName denotes the record expiry time.
const MaxLogNumLines = 1000
MaxLogNumLines is the max number of log lines that can be tailed.
const NamserviceVersion = "0.3.0"
NamserviceVersion is the registry API version.
const OwnerAttributeName = "owner"
OwnerAttributeName denotes the owner attribute name for a bond.
Variables ¶
var NodeDataPath = os.ExpandEnv("$HOME/.wire/wnsd/data")
NodeDataPath is the path to the wnsd data folder.
Functions ¶
func GetDiskUsage ¶
GetDiskUsage returns disk usage for the given path.
func MatchOnAttributes ¶
func MatchOnAttributes(record *nameservice.Record, attributes []*KeyValueInput, all bool) bool
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type AuthorityRecord ¶ added in v0.6.0
type AuthorityRecord struct {
OwnerAddress string `json:"ownerAddress"`
OwnerPublicKey string `json:"ownerPublicKey"`
Height string `json:"height"`
}
func GetGQLNameAuthorityRecord ¶ added in v0.6.0
func GetGQLNameAuthorityRecord(ctx context.Context, resolver QueryResolver, record *nameservice.NameAuthority) (*AuthorityRecord, error)
type AuthorityResult ¶ added in v0.6.0
type AuthorityResult struct {
Meta ResultMeta `json:"meta"`
Records []*AuthorityRecord `json:"records"`
}
type ComplexityRoot ¶
type ComplexityRoot struct {
Account struct {
Address func(childComplexity int) int
PubKey func(childComplexity int) int
Number func(childComplexity int) int
Sequence func(childComplexity int) int
Balance func(childComplexity int) int
}
AuthorityRecord struct {
OwnerAddress func(childComplexity int) int
OwnerPublicKey func(childComplexity int) int
Height func(childComplexity int) int
}
AuthorityResult struct {
Meta func(childComplexity int) int
Records func(childComplexity int) int
}
Bond struct {
ID func(childComplexity int) int
Owner func(childComplexity int) int
Balance func(childComplexity int) int
}
Coin struct {
Type func(childComplexity int) int
Quantity func(childComplexity int) int
}
KeyValue struct {
Key func(childComplexity int) int
Value func(childComplexity int) int
}
Mutation struct {
InsertRecord func(childComplexity int, attributes []*KeyValueInput) int
Submit func(childComplexity int, tx string) int
}
NameRecord struct {
Latest func(childComplexity int) int
History func(childComplexity int) int
}
NameRecordEntry struct {
ID func(childComplexity int) int
Height func(childComplexity int) int
}
NameResult struct {
Meta func(childComplexity int) int
Records func(childComplexity int) int
}
NodeInfo struct {
ID func(childComplexity int) int
Network func(childComplexity int) int
Moniker func(childComplexity int) int
}
PeerInfo struct {
Node func(childComplexity int) int
IsOutbound func(childComplexity int) int
RemoteIP func(childComplexity int) int
}
Query struct {
GetStatus func(childComplexity int) int
GetLogs func(childComplexity int, count *int) int
GetAccounts func(childComplexity int, addresses []string) int
GetBondsByIds func(childComplexity int, ids []string) int
QueryBonds func(childComplexity int, attributes []*KeyValueInput) int
GetRecordsByIds func(childComplexity int, ids []string) int
QueryRecords func(childComplexity int, attributes []*KeyValueInput, all *bool) int
LookupAuthorities func(childComplexity int, names []string) int
LookupNames func(childComplexity int, names []string) int
ResolveNames func(childComplexity int, names []string) int
}
Record struct {
ID func(childComplexity int) int
Names func(childComplexity int) int
BondID func(childComplexity int) int
CreateTime func(childComplexity int) int
ExpiryTime func(childComplexity int) int
Owners func(childComplexity int) int
Attributes func(childComplexity int) int
References func(childComplexity int) int
}
RecordResult struct {
Meta func(childComplexity int) int
Records func(childComplexity int) int
}
Reference struct {
ID func(childComplexity int) int
}
ResultMeta struct {
Height func(childComplexity int) int
}
Status struct {
Version func(childComplexity int) int
Node func(childComplexity int) int
Sync func(childComplexity int) int
Validator func(childComplexity int) int
Validators func(childComplexity int) int
NumPeers func(childComplexity int) int
Peers func(childComplexity int) int
DiskUsage func(childComplexity int) int
}
SyncInfo struct {
LatestBlockHash func(childComplexity int) int
LatestBlockHeight func(childComplexity int) int
LatestBlockTime func(childComplexity int) int
CatchingUp func(childComplexity int) int
}
ValidatorInfo struct {
Address func(childComplexity int) int
VotingPower func(childComplexity int) int
ProposerPriority func(childComplexity int) int
}
Value struct {
Null func(childComplexity int) int
Int func(childComplexity int) int
Float func(childComplexity int) int
String func(childComplexity int) int
Boolean func(childComplexity int) int
JSON func(childComplexity int) int
Reference 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 MutationResolver ¶
type NameRecord ¶ added in v0.6.0
type NameRecord struct {
Latest NameRecordEntry `json:"latest"`
History []*NameRecordEntry `json:"history"`
}
func GetGQLNameRecord ¶ added in v0.6.0
func GetGQLNameRecord(ctx context.Context, resolver QueryResolver, record *nameservice.NameRecord) (*NameRecord, error)
type NameRecordEntry ¶ added in v0.6.0
type NameResult ¶ added in v0.6.0
type NameResult struct {
Meta ResultMeta `json:"meta"`
Records []*NameRecord `json:"records"`
}
type QueryResolver ¶
type QueryResolver interface {
GetStatus(ctx context.Context) (*Status, error)
GetLogs(ctx context.Context, count *int) ([]string, 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)
GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error)
QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error)
LookupAuthorities(ctx context.Context, names []string) (*AuthorityResult, error)
LookupNames(ctx context.Context, names []string) (*NameResult, error)
ResolveNames(ctx context.Context, names []string) (*RecordResult, error)
}
type Record ¶
type Record struct {
ID string `json:"id"`
Names []string `json:"names"`
BondID string `json:"bondId"`
CreateTime string `json:"createTime"`
ExpiryTime string `json:"expiryTime"`
Owners []*string `json:"owners"`
Attributes []*KeyValue `json:"attributes"`
References []*Record `json:"references"`
}
func GetGQLRecord ¶
func GetGQLRecord(ctx context.Context, resolver QueryResolver, record *nameservice.Record) (*Record, error)
func QueryRecords ¶
func QueryRecords(ctx context.Context, resolver QueryResolver, records []*nameservice.Record, attributes []*KeyValueInput) ([]*Record, error)
QueryRecords filters records by K=V conditions.
type RecordResult ¶ added in v0.6.0
type RecordResult struct {
Meta ResultMeta `json:"meta"`
Records []*Record `json:"records"`
}
type ReferenceInput ¶
type ReferenceInput struct {
ID string `json:"id"`
}
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is the GQL query resolver.
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation is the entry point to tx execution.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query is the entry point to query execution.
type ResolverRoot ¶
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
}
type ResultMeta ¶ added in v0.6.0
type ResultMeta struct {
Height string `json:"height"`
}
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"`
}