Documentation ¶
Index ¶
- Constants
- func NewClient(endpoint string, options ...Option) (graphql.Client, error)
- type Option
- type ProposalProposalsProposal
- func (v *ProposalProposalsProposal) GetAuthor() string
- func (v *ProposalProposalsProposal) GetBody() string
- func (v *ProposalProposalsProposal) GetChoices() []string
- func (v *ProposalProposalsProposal) GetCreated() int
- func (v *ProposalProposalsProposal) GetEnd() int
- func (v *ProposalProposalsProposal) GetId() string
- func (v *ProposalProposalsProposal) GetLink() string
- func (v *ProposalProposalsProposal) GetSpace() ProposalProposalsProposalSpace
- func (v *ProposalProposalsProposal) GetStart() int
- func (v *ProposalProposalsProposal) GetState() string
- func (v *ProposalProposalsProposal) GetTitle() string
- type ProposalProposalsProposalSpace
- type ProposalResponse
- type ProposalsProposalsProposal
- func (v *ProposalsProposalsProposal) GetAuthor() string
- func (v *ProposalsProposalsProposal) GetBody() string
- func (v *ProposalsProposalsProposal) GetChoices() []string
- func (v *ProposalsProposalsProposal) GetCreated() int
- func (v *ProposalsProposalsProposal) GetEnd() int
- func (v *ProposalsProposalsProposal) GetId() string
- func (v *ProposalsProposalsProposal) GetLink() string
- func (v *ProposalsProposalsProposal) GetSpace() ProposalsProposalsProposalSpace
- func (v *ProposalsProposalsProposal) GetStart() int
- func (v *ProposalsProposalsProposal) GetState() string
- func (v *ProposalsProposalsProposal) GetTitle() string
- type ProposalsProposalsProposalSpace
- type ProposalsResponse
- type VoteResponse
- type VoteVotesVote
- type VotesResponse
- type VotesVotesVote
Constants ¶
const ( EndpointMainnet = "https://hub.snapshot.org/graphql" EndpointTestnet = "https://testnet.snapshot.org/graphql" Limit = 1000 ProposalStateClosed = "closed" )
const Proposal_Operation = `` /* 182-byte string literal not displayed */
The query or mutation executed by Proposal.
const Proposals_Operation = `` /* 253-byte string literal not displayed */
The query or mutation executed by Proposals.
const Vote_Operation = `
query Vote ($id: String) {
votes(where: {id:$id}) {
id
voter
created
choice
vp
reason
}
}
`
The query or mutation executed by Vote.
const Votes_Operation = `` /* 214-byte string literal not displayed */
The query or mutation executed by Votes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(client *client) error
Option is a function that can be used to configure a [client].
func WithAPIKey ¶
WithAPIKey is an Option that can be used to set the X-API-KEY header for requests.
type ProposalProposalsProposal ¶
type ProposalProposalsProposal struct { Id string `json:"id"` Link string `json:"link"` Title string `json:"title"` Body string `json:"body"` Choices []string `json:"choices"` Start int `json:"start"` End int `json:"end"` State string `json:"state"` Author string `json:"author"` Created int `json:"created"` Space ProposalProposalsProposalSpace `json:"space"` }
ProposalProposalsProposal includes the requested fields of the GraphQL type Proposal.
func (*ProposalProposalsProposal) GetAuthor ¶
func (v *ProposalProposalsProposal) GetAuthor() string
GetAuthor returns ProposalProposalsProposal.Author, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetBody ¶
func (v *ProposalProposalsProposal) GetBody() string
GetBody returns ProposalProposalsProposal.Body, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetChoices ¶
func (v *ProposalProposalsProposal) GetChoices() []string
GetChoices returns ProposalProposalsProposal.Choices, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetCreated ¶
func (v *ProposalProposalsProposal) GetCreated() int
GetCreated returns ProposalProposalsProposal.Created, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetEnd ¶
func (v *ProposalProposalsProposal) GetEnd() int
GetEnd returns ProposalProposalsProposal.End, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetId ¶
func (v *ProposalProposalsProposal) GetId() string
GetId returns ProposalProposalsProposal.Id, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetLink ¶
func (v *ProposalProposalsProposal) GetLink() string
GetLink returns ProposalProposalsProposal.Link, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetSpace ¶
func (v *ProposalProposalsProposal) GetSpace() ProposalProposalsProposalSpace
GetSpace returns ProposalProposalsProposal.Space, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetStart ¶
func (v *ProposalProposalsProposal) GetStart() int
GetStart returns ProposalProposalsProposal.Start, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetState ¶
func (v *ProposalProposalsProposal) GetState() string
GetState returns ProposalProposalsProposal.State, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposal) GetTitle ¶
func (v *ProposalProposalsProposal) GetTitle() string
GetTitle returns ProposalProposalsProposal.Title, and is useful for accessing the field via an interface.
type ProposalProposalsProposalSpace ¶
type ProposalProposalsProposalSpace struct { Id string `json:"id"` Name string `json:"name"` About string `json:"about"` }
ProposalProposalsProposalSpace includes the requested fields of the GraphQL type Space.
func (*ProposalProposalsProposalSpace) GetAbout ¶
func (v *ProposalProposalsProposalSpace) GetAbout() string
GetAbout returns ProposalProposalsProposalSpace.About, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposalSpace) GetId ¶
func (v *ProposalProposalsProposalSpace) GetId() string
GetId returns ProposalProposalsProposalSpace.Id, and is useful for accessing the field via an interface.
func (*ProposalProposalsProposalSpace) GetName ¶
func (v *ProposalProposalsProposalSpace) GetName() string
GetName returns ProposalProposalsProposalSpace.Name, and is useful for accessing the field via an interface.
type ProposalResponse ¶
type ProposalResponse struct {
Proposals []ProposalProposalsProposal `json:"proposals"`
}
ProposalResponse is returned by Proposal on success.
func (*ProposalResponse) GetProposals ¶
func (v *ProposalResponse) GetProposals() []ProposalProposalsProposal
GetProposals returns ProposalResponse.Proposals, and is useful for accessing the field via an interface.
type ProposalsProposalsProposal ¶
type ProposalsProposalsProposal struct { Id string `json:"id"` Link string `json:"link"` Title string `json:"title"` Body string `json:"body"` Choices []string `json:"choices"` Start int `json:"start"` End int `json:"end"` State string `json:"state"` Author string `json:"author"` Created int `json:"created"` Space ProposalsProposalsProposalSpace `json:"space"` }
ProposalsProposalsProposal includes the requested fields of the GraphQL type Proposal.
func (*ProposalsProposalsProposal) GetAuthor ¶
func (v *ProposalsProposalsProposal) GetAuthor() string
GetAuthor returns ProposalsProposalsProposal.Author, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetBody ¶
func (v *ProposalsProposalsProposal) GetBody() string
GetBody returns ProposalsProposalsProposal.Body, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetChoices ¶
func (v *ProposalsProposalsProposal) GetChoices() []string
GetChoices returns ProposalsProposalsProposal.Choices, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetCreated ¶
func (v *ProposalsProposalsProposal) GetCreated() int
GetCreated returns ProposalsProposalsProposal.Created, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetEnd ¶
func (v *ProposalsProposalsProposal) GetEnd() int
GetEnd returns ProposalsProposalsProposal.End, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetId ¶
func (v *ProposalsProposalsProposal) GetId() string
GetId returns ProposalsProposalsProposal.Id, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetLink ¶
func (v *ProposalsProposalsProposal) GetLink() string
GetLink returns ProposalsProposalsProposal.Link, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetSpace ¶
func (v *ProposalsProposalsProposal) GetSpace() ProposalsProposalsProposalSpace
GetSpace returns ProposalsProposalsProposal.Space, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetStart ¶
func (v *ProposalsProposalsProposal) GetStart() int
GetStart returns ProposalsProposalsProposal.Start, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetState ¶
func (v *ProposalsProposalsProposal) GetState() string
GetState returns ProposalsProposalsProposal.State, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposal) GetTitle ¶
func (v *ProposalsProposalsProposal) GetTitle() string
GetTitle returns ProposalsProposalsProposal.Title, and is useful for accessing the field via an interface.
type ProposalsProposalsProposalSpace ¶
type ProposalsProposalsProposalSpace struct { Id string `json:"id"` Name string `json:"name"` About string `json:"about"` }
ProposalsProposalsProposalSpace includes the requested fields of the GraphQL type Space.
func (*ProposalsProposalsProposalSpace) GetAbout ¶
func (v *ProposalsProposalsProposalSpace) GetAbout() string
GetAbout returns ProposalsProposalsProposalSpace.About, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposalSpace) GetId ¶
func (v *ProposalsProposalsProposalSpace) GetId() string
GetId returns ProposalsProposalsProposalSpace.Id, and is useful for accessing the field via an interface.
func (*ProposalsProposalsProposalSpace) GetName ¶
func (v *ProposalsProposalsProposalSpace) GetName() string
GetName returns ProposalsProposalsProposalSpace.Name, and is useful for accessing the field via an interface.
type ProposalsResponse ¶
type ProposalsResponse struct {
Proposals []ProposalsProposalsProposal `json:"proposals"`
}
ProposalsResponse is returned by Proposals on success.
func (*ProposalsResponse) GetProposals ¶
func (v *ProposalsResponse) GetProposals() []ProposalsProposalsProposal
GetProposals returns ProposalsResponse.Proposals, and is useful for accessing the field via an interface.
type VoteResponse ¶
type VoteResponse struct {
Votes []VoteVotesVote `json:"votes"`
}
VoteResponse is returned by Vote on success.
func (*VoteResponse) GetVotes ¶
func (v *VoteResponse) GetVotes() []VoteVotesVote
GetVotes returns VoteResponse.Votes, and is useful for accessing the field via an interface.
type VoteVotesVote ¶
type VoteVotesVote struct { Id string `json:"id"` Voter string `json:"voter"` Created int `json:"created"` Choice any `json:"choice"` Vp float64 `json:"vp"` Reason string `json:"reason"` }
VoteVotesVote includes the requested fields of the GraphQL type Vote.
func (*VoteVotesVote) GetChoice ¶
func (v *VoteVotesVote) GetChoice() any
GetChoice returns VoteVotesVote.Choice, and is useful for accessing the field via an interface.
func (*VoteVotesVote) GetCreated ¶
func (v *VoteVotesVote) GetCreated() int
GetCreated returns VoteVotesVote.Created, and is useful for accessing the field via an interface.
func (*VoteVotesVote) GetId ¶
func (v *VoteVotesVote) GetId() string
GetId returns VoteVotesVote.Id, and is useful for accessing the field via an interface.
func (*VoteVotesVote) GetReason ¶
func (v *VoteVotesVote) GetReason() string
GetReason returns VoteVotesVote.Reason, and is useful for accessing the field via an interface.
func (*VoteVotesVote) GetVoter ¶
func (v *VoteVotesVote) GetVoter() string
GetVoter returns VoteVotesVote.Voter, and is useful for accessing the field via an interface.
func (*VoteVotesVote) GetVp ¶
func (v *VoteVotesVote) GetVp() float64
GetVp returns VoteVotesVote.Vp, and is useful for accessing the field via an interface.
type VotesResponse ¶
type VotesResponse struct {
Votes []VotesVotesVote `json:"votes"`
}
VotesResponse is returned by Votes on success.
func (*VotesResponse) GetVotes ¶
func (v *VotesResponse) GetVotes() []VotesVotesVote
GetVotes returns VotesResponse.Votes, and is useful for accessing the field via an interface.
type VotesVotesVote ¶
type VotesVotesVote struct { Id string `json:"id"` Voter string `json:"voter"` Created int `json:"created"` Choice any `json:"choice"` Vp float64 `json:"vp"` Reason string `json:"reason"` }
VotesVotesVote includes the requested fields of the GraphQL type Vote.
func (*VotesVotesVote) GetChoice ¶
func (v *VotesVotesVote) GetChoice() any
GetChoice returns VotesVotesVote.Choice, and is useful for accessing the field via an interface.
func (*VotesVotesVote) GetCreated ¶
func (v *VotesVotesVote) GetCreated() int
GetCreated returns VotesVotesVote.Created, and is useful for accessing the field via an interface.
func (*VotesVotesVote) GetId ¶
func (v *VotesVotesVote) GetId() string
GetId returns VotesVotesVote.Id, and is useful for accessing the field via an interface.
func (*VotesVotesVote) GetReason ¶
func (v *VotesVotesVote) GetReason() string
GetReason returns VotesVotesVote.Reason, and is useful for accessing the field via an interface.
func (*VotesVotesVote) GetVoter ¶
func (v *VotesVotesVote) GetVoter() string
GetVoter returns VotesVotesVote.Voter, and is useful for accessing the field via an interface.
func (*VotesVotesVote) GetVp ¶
func (v *VotesVotesVote) GetVp() float64
GetVp returns VotesVotesVote.Vp, and is useful for accessing the field via an interface.