Documentation
¶
Overview ¶
Package grpc provides a gRPC client that implements the acl.I interface. This allows the relay to use a remote ACL server via gRPC.
Index ¶
- type Client
- func (c *Client) AddFollow(pubkey []byte) error
- func (c *Client) AllowPubkey(pubkey, reason string) error
- func (c *Client) BanPubkey(pubkey, reason string) error
- func (c *Client) BlacklistPubkey(pubkey, reason string) error
- func (c *Client) BlockIP(ip, reason string) error
- func (c *Client) CheckPolicy(ev *event.E) (bool, error)
- func (c *Client) Close() error
- func (c *Client) Configure(cfg ...any) error
- func (c *Client) DisallowPubkey(pubkey string) error
- func (c *Client) GetACLInfo() (name, description, documentation string)
- func (c *Client) GetAccessLevel(pub []byte, address string) string
- func (c *Client) GetAdminRelays() []string
- func (c *Client) GetFollowedPubkeys() [][]byte
- func (c *Client) GetThrottleDelay(pubkey []byte, ip string) time.Duration
- func (c *Client) IsCuratingConfigured() (bool, error)
- func (c *Client) RateLimitCheck(pubkey, ip string) (allowed bool, message string, err error)
- func (c *Client) Ready() <-chan struct{}
- func (c *Client) Syncer()
- func (c *Client) TrustPubkey(pubkey, note string) error
- func (c *Client) Type() string
- func (c *Client) UnbanPubkey(pubkey string) error
- func (c *Client) UnblacklistPubkey(pubkey string) error
- func (c *Client) UnblockIP(ip string) error
- func (c *Client) UntrustPubkey(pubkey string) error
- func (c *Client) UpdatePeerAdmins(peerPubkeys [][]byte) error
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the acl.I interface via gRPC.
func New ¶
func New(ctx context.Context, cfg *ClientConfig) (*Client, error)
New creates a new gRPC ACL client.
func (*Client) AllowPubkey ¶
AllowPubkey adds a pubkey to the allow list.
func (*Client) BlacklistPubkey ¶
BlacklistPubkey adds a pubkey to the blacklist.
func (*Client) DisallowPubkey ¶
DisallowPubkey removes a pubkey from the allow list.
func (*Client) GetACLInfo ¶
func (*Client) GetAdminRelays ¶
GetAdminRelays returns the admin relay URLs.
func (*Client) GetFollowedPubkeys ¶
GetFollowedPubkeys returns all followed pubkeys.
func (*Client) GetThrottleDelay ¶
GetThrottleDelay returns the progressive throttle delay for a pubkey.
func (*Client) IsCuratingConfigured ¶
IsCuratingConfigured checks if curating mode is configured.
func (*Client) RateLimitCheck ¶
RateLimitCheck checks if a pubkey/IP can publish.
func (*Client) Ready ¶
func (c *Client) Ready() <-chan struct{}
Ready returns a channel that closes when the client is ready.
func (*Client) TrustPubkey ¶
TrustPubkey adds a pubkey to the trusted list.
func (*Client) UnbanPubkey ¶
UnbanPubkey removes a pubkey from the ban list.
func (*Client) UnblacklistPubkey ¶
UnblacklistPubkey removes a pubkey from the blacklist.
func (*Client) UntrustPubkey ¶
UntrustPubkey removes a pubkey from the trusted list.
func (*Client) UpdatePeerAdmins ¶
UpdatePeerAdmins updates the peer relay identity pubkeys.
type ClientConfig ¶
ClientConfig holds configuration for the gRPC ACL client.