Documentation
¶
Index ¶
- Constants
- Variables
- func APIKeyFlag(v *viper.Viper, f *pflag.FlagSet)
- func APISecretFlag(v *viper.Viper, f *pflag.FlagSet)
- func APIURLFlag(v *viper.Viper, f *pflag.FlagSet)
- func ClientPoolIDFlag(v *viper.Viper, f *pflag.FlagSet)
- func Flags(v *viper.Viper, f *pflag.FlagSet)
- func GetAPIKey(v *viper.Viper) string
- func GetAPISecret(v *viper.Viper) string
- func GetAPIURL(v *viper.Viper) string
- func GetClientPoolID(v *viper.Viper) string
- func GetUserPoolID(v *viper.Viper) string
- func UserPoolIDFlag(v *viper.Viper, f *pflag.FlagSet)
- type ArchiveReqMsg
- type Client
- func (c *Client) AddressBook(_ context.Context) (map[string]string, error)
- func (c *Client) ArchiveProposal(ctx context.Context, contractID, proposalID string) error
- func (c *Client) CreateProposal(ctx context.Context, msg *defenderclient.CreateProposalReqMsg) (*defenderclient.ProposalRespMsg, error)
- func (c *Client) GetProposal(_ context.Context, _, _ string) (*defenderclient.ProposalRespMsg, error)
- func (c *Client) GetProposalByList(ctx context.Context, _, proposalID string) (*defenderclient.ProposalRespMsg, error)
- func (c *Client) Init(ctx context.Context) error
- func (c *Client) ListContracts(ctx context.Context) ([]*defenderclient.ContractMsg, error)
- func (c *Client) ListProposals(ctx context.Context, includeArchived bool) ([]*defenderclient.ProposalRespMsg, error)
- type Config
- type ErrorMsg
Constants ¶
View Source
const ( UserPoolIDEnv = "DEFENDER_USER_POOL_ID" UserPoolIDDefault = "us-west-2_94f3puJWv" )
View Source
const ( ClientPoolIDEnv = "DEFENDER_CLIENT_POOL_ID" ClientPoolIDDefault = "40e58hbc7pktmnp9i26hh5nsav" )
View Source
const ( APIURLEnv = "DEFENDER_API_URL" APIURLDefault = "https://defender-api.openzeppelin.com/admin" )
View Source
const (
APIKeyEnv = "DEFENDER_API_KEY"
)
View Source
const (
APISecretEnv = "DEFENDER_API_SECRET"
)
Variables ¶
View Source
var ErrNotImplemented = fmt.Errorf("not implemented")
Functions ¶
func APIKeyFlag ¶
APIKeyFlag register flag for Authentication apiKey
func APISecretFlag ¶
APISecretFlag register flag for Authentication apiSecret
func APIURLFlag ¶
APIURLFlag register flag for Authentication apiURL
func ClientPoolIDFlag ¶
ClientPoolIDFlag register flag for Authentication clientPoolID
func GetAPISecret ¶
func GetClientPoolID ¶
func GetUserPoolID ¶
Types ¶
type ArchiveReqMsg ¶
type ArchiveReqMsg struct {
Archived bool `json:"archived"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddressBook ¶
func (*Client) ArchiveProposal ¶
func (*Client) CreateProposal ¶
func (c *Client) CreateProposal(ctx context.Context, msg *defenderclient.CreateProposalReqMsg) (*defenderclient.ProposalRespMsg, error)
func (*Client) GetProposal ¶
func (c *Client) GetProposal(_ context.Context, _, _ string) (*defenderclient.ProposalRespMsg, error)
func (*Client) GetProposalByList ¶
func (c *Client) GetProposalByList(ctx context.Context, _, proposalID string) (*defenderclient.ProposalRespMsg, error)
func (*Client) ListContracts ¶
func (c *Client) ListContracts(ctx context.Context) ([]*defenderclient.ContractMsg, error)
func (*Client) ListProposals ¶
func (c *Client) ListProposals(ctx context.Context, includeArchived bool) ([]*defenderclient.ProposalRespMsg, error)
type Config ¶
type Config struct {
APIKey, APISecret, UserPoolID, ClientPoolID, APIURL string
}
func NewConfigFromViper ¶
func (*Config) SetDefault ¶
Click to show internal directories.
Click to hide internal directories.