Documentation
¶
Overview ¶
Package client provides job client operations for NATS JetStream.
Index ¶
- Constants
- Variables
- type AgentKey
- type AgentKeyStore
- type Client
- func (c *Client) AgentsLastSeen(ctx context.Context) (map[string]time.Time, error)
- func (c *Client) CheckDrainFlag(ctx context.Context, machineID string) bool
- func (c *Client) ConsumeJobs(ctx context.Context, streamName, consumerName string, ...) error
- func (c *Client) ControllerKey(ctx context.Context) (pki.ControllerKeyRecord, bool, error)
- func (c *Client) CreateJob(ctx context.Context, operationData map[string]interface{}, ...) (*CreateJobResult, error)
- func (c *Client) CreateOrUpdateConsumer(ctx context.Context, streamName string, ...) error
- func (c *Client) DeleteDrainFlag(ctx context.Context, machineID string) error
- func (c *Client) DeleteJob(ctx context.Context, jobID string) error
- func (c *Client) GetAgent(ctx context.Context, target string) (*job.AgentInfo, error)
- func (c *Client) GetAgentConfig(ctx context.Context, machineID string) (job.AgentConfig, error)
- func (c *Client) GetAgentTimeline(ctx context.Context, machineID string, hostname string) ([]job.TimelineEvent, error)
- func (c *Client) GetJobData(ctx context.Context, jobKey string) ([]byte, error)
- func (c *Client) GetJobStatus(ctx context.Context, jobID string) (*job.QueuedJob, error)
- func (c *Client) GetQueueSummary(ctx context.Context) (*job.QueueStats, error)
- func (c *Client) HasJobResponse(ctx context.Context, jobID string, hostname string) (bool, error)
- func (c *Client) ListAgents(ctx context.Context) ([]job.AgentInfo, error)
- func (c *Client) ListDeadLetters(ctx context.Context, limit int) ([]job.DeadLetter, int, error)
- func (c *Client) ListJobs(ctx context.Context, statusFilter types.JobStatus, limit int, offset int, ...) (*ListJobsResult, error)
- func (c *Client) Modify(ctx context.Context, target string, category string, ...) (string, *job.Response, error)
- func (c *Client) ModifyBroadcast(ctx context.Context, target string, category string, ...) (string, map[string]*job.Response, error)
- func (c *Client) NATSCert(ctx context.Context) (pki.CertRecord, bool, error)
- func (c *Client) Query(ctx context.Context, target string, category string, ...) (string, *job.Response, error)
- func (c *Client) QueryBroadcast(ctx context.Context, target string, category string, ...) (string, map[string]*job.Response, error)
- func (c *Client) RetryJob(ctx context.Context, jobID string, targetHostname string) (*CreateJobResult, error)
- func (c *Client) SetAgentConfig(ctx context.Context, machineID string, set job.AgentConfig) (job.AgentConfig, error)
- func (c *Client) SetAgentKeyStore(store AgentKeyStore)
- func (c *Client) SetAudit(w audit.Writer)
- func (c *Client) SetDrainFlag(ctx context.Context, machineID string) error
- func (c *Client) SetMachineID(machineID string)
- func (c *Client) SetMeterProvider(mp *sdkmetric.MeterProvider)
- func (c *Client) SetPKISigner(signer PKISigner)
- func (c *Client) WriteAgentSeen(ctx context.Context, machineID string) error
- func (c *Client) WriteAgentTimelineEvent(ctx context.Context, machineID, hostname, event, message string) error
- func (c *Client) WriteJobResponse(ctx context.Context, jobID, hostname string, responseData []byte, ...) error
- func (c *Client) WriteStatusEvent(ctx context.Context, jobID string, event types.AgentJobStatus, hostname string, ...) error
- type Connection
- type ConsumerStore
- type CreateJobResult
- type JobClient
- type ListJobsResult
- type NATSClient
- type Options
- type PKISigner
- type RefusedError
Constants ¶
const ( // DefaultPageSize is the default number of jobs per page. DefaultPageSize = 10 // MaxPageSize is the maximum allowed page size. MaxPageSize = 100 )
Variables ¶
var ( // ErrNoSigner means a job client with no signing key: it writes no job // and no response, and reads no record or response, because each one // is signed. The controller and an enrolled agent always have one. ErrNoSigner = errors.New("the job client has no signing key") // ErrNoAgentKeys means a job client with no agent keys: it refuses a // job with a secret, which it cannot seal, and each response of an // agent, which it cannot verify. The controller always has them. ErrNoAgentKeys = errors.New("the job client has no agent keys") // ErrNotSigned means a stored value that is not a signed envelope. A // reader refuses it. ErrNotSigned = errors.New("the value is not a signed envelope") // ErrResponseNotSigned means the response carried no signed envelope. // Expected from an agent that has not been upgraded; never accepted // while enforcing. ErrResponseNotSigned = errors.New("response is not a signed envelope") // ErrResponseKeyUnknown means no key is stored for the machine ID the // response claims. Expected during a rollout, before that agent // re-enrolls. ErrResponseKeyUnknown = errors.New("no stored key for responding agent") // never mistaken for "no stored key". ErrResponseStoreUnavailable = errors.New("agent key store unavailable") // ErrResponseSignatureInvalid means a key that is not the stored key // for that agent signed the response. ErrResponseSignatureInvalid = errors.New("invalid agent signature on response") )
The causes of a rejected response stay distinct so an operator can tell an agent that has not re-enrolled yet from one whose messages are being forged, and both from a store that cannot be read. None of them ever means "treat as verified".
Functions ¶
This section is empty.
Types ¶
type AgentKey ¶
type AgentKey struct {
// MachineID is the permanent host identifier the record is keyed by.
MachineID string
// Hostname is the hostname recorded at acceptance. A response claiming
// a different hostname is not this agent's to answer for.
Hostname string
// PublicKey is the key recorded at acceptance.
PublicKey ed25519.PublicKey
// SupersededKey is the key a rotation replaced, kept acceptable until
// SupersededUntil so a message signed moments before the rotation is not
// rejected for arriving late. Absent outside a rotation window.
SupersededKey ed25519.PublicKey
// SupersededUntil is the instant the superseded key stops being accepted.
SupersededUntil time.Time
// EncryptionKey is the public P-256 key of the agent, in
// pki.EncryptionKeyEncoding, that the controller seals the secrets of a job to. Empty for an
// agent that enrolled before agents had one.
EncryptionKey string
}
AgentKey is what the controller holds for an accepted agent: the key its messages are verified against, and the hostname it enrolled under.
func (*AgentKey) AcceptableKeys ¶
AcceptableKeys returns the keys a message from this agent may be signed with: the current one, and the key a rotation replaced while it is still inside its grace period.
An expired superseded key is simply not returned, so a signature matching only it fails as a mismatch rather than as its own outcome. That is deliberate: after the window, that key is no longer this agent's.
type AgentKeyStore ¶
type AgentKeyStore interface {
LookupAgentKey(
ctx context.Context,
machineID string,
) (*AgentKey, error)
// RenameAgentKey records hostname as the name that machineID answers
// as, after an operator renamed the host through osapi.
RenameAgentKey(
ctx context.Context,
machineID string,
hostname string,
) error
}
AgentKeyStore looks up an accepted agent's key by machine ID. A job client with no store refuses each response of an agent.
Implemented on the controller by the enrollment watcher, which is the only thing allowed to write the underlying records.
type Client ¶
type Client struct {
// JSONMarshalFn is the function used to marshal JSON. Defaults to json.Marshal.
// Exported for testing.
JSONMarshalFn func(v any) ([]byte, error)
// contains filtered or unexported fields
}
Client provides methods for publishing job requests and retrieving responses.
func (*Client) AgentsLastSeen ¶ added in v0.3.0
AgentsLastSeen returns when each agent last reported, by machine ID. A value that does not read is left out.
func (*Client) CheckDrainFlag ¶
CheckDrainFlag returns true if the drain flag exists for the given identifier. Callers pass a machine ID (hex string, no sanitization needed).
func (*Client) ConsumeJobs ¶
func (c *Client) ConsumeJobs( ctx context.Context, streamName, consumerName string, handler natsclient.JetStreamMessageHandler, opts *natsclient.ConsumeOptions, ) error
ConsumeJobs sets up message consumption for job processing.
func (*Client) ControllerKey ¶ added in v0.3.0
ControllerKey is the record of the rotation of the controller's key, in a pki.controller_key.get span. With no record, it is the zero record and false: the controller has not rotated its key, and has written none.
func (*Client) CreateJob ¶
func (c *Client) CreateJob( ctx context.Context, operationData map[string]interface{}, targetHostname string, ) (*CreateJobResult, error)
CreateJob creates a new job from operation data and stores it in the KV bucket.
func (*Client) CreateOrUpdateConsumer ¶
func (c *Client) CreateOrUpdateConsumer( ctx context.Context, streamName string, consumerConfig jetstream.ConsumerConfig, ) error
CreateOrUpdateConsumer creates or updates a JetStream consumer.
NATS refuses to change the deliver policy of a consumer that exists. When the update fails and the existing consumer has a different deliver policy, such as a consumer that an earlier build made, the client removes it and makes it again with consumerConfig. Thus an upgraded agent gets its consumers without a person. The new consumer starts at its own deliver policy, not at the position of the old one.
func (*Client) DeleteDrainFlag ¶
DeleteDrainFlag removes the drain flag for an agent from the state KV bucket. The agent detects this on heartbeat and resumes accepting jobs. Callers pass a machine ID (hex string, no sanitization needed).
func (*Client) GetAgent ¶
GetAgent returns one agent by its hostname or machine ID, in an agent.get span.
func (*Client) GetAgentConfig ¶ added in v0.3.0
GetAgentConfig is the config that the controller holds for the agent with machineID, in an agent.config.get span. An agent that has none has the zero config, version 0.
func (*Client) GetAgentTimeline ¶
func (c *Client) GetAgentTimeline( ctx context.Context, machineID string, hostname string, ) ([]job.TimelineEvent, error)
GetAgentTimeline returns the timeline of an agent, in an agent.timeline span.
func (*Client) GetJobData ¶
GetJobData retrieves raw job data from the KV store.
func (*Client) GetJobStatus ¶
GetJobStatus returns one job and its computed status, in a job.get span.
func (*Client) GetQueueSummary ¶
GetQueueSummary returns the counts of the queue, in a job.summary span.
func (*Client) HasJobResponse ¶
func (c *Client) HasJobResponse( ctx context.Context, jobID string, hostname string, ) (bool, error)
HasJobResponse reports whether this agent has already written a response for the given job. A redelivered message must not re-execute an operation this agent has already answered, so the handler checks this before running the operation. The check is scoped to hostname so broadcast jobs, where every targeted agent responds independently, remain unaffected.
func (*Client) ListAgents ¶
ListAgents returns each agent in the registry, in an agent.list span.
func (*Client) ListDeadLetters ¶ added in v0.3.0
ListDeadLetters is up to limit of the newest dead letters, newest first, each with the job that it carried, and the count of them all, in a job.deadletter.list span.
func (*Client) ListJobs ¶
func (c *Client) ListJobs( ctx context.Context, statusFilter types.JobStatus, limit int, offset int, keep func(target string) bool, ) (*ListJobsResult, error)
ListJobs returns a page of jobs, in a job.list span that records how many jobs the page has. A non-nil keep drops each job whose target it rejects before the jobs are counted and paged.
func (*Client) Modify ¶
func (c *Client) Modify( ctx context.Context, target string, category string, operation job.OperationType, data any, ) (string, *job.Response, error)
Modify publishes a modify job to a single target and waits for the response.
func (*Client) ModifyBroadcast ¶
func (c *Client) ModifyBroadcast( ctx context.Context, target string, category string, operation job.OperationType, data any, ) (string, map[string]*job.Response, error)
ModifyBroadcast publishes a modify job to a broadcast target and collects all responses.
func (*Client) NATSCert ¶ added in v0.3.0
NATSCert is the record of the rotation of the NATS server's certificate, in a pki.nats_cert.get span. With no record, it is the zero record and false: the certificate has not rotated.
func (*Client) Query ¶
func (c *Client) Query( ctx context.Context, target string, category string, operation job.OperationType, data any, ) (string, *job.Response, error)
Query publishes a query job to a single target and waits for the response.
func (*Client) QueryBroadcast ¶
func (c *Client) QueryBroadcast( ctx context.Context, target string, category string, operation job.OperationType, data any, ) (string, map[string]*job.Response, error)
QueryBroadcast publishes a query job to a broadcast target and collects all responses.
func (*Client) RetryJob ¶
func (c *Client) RetryJob( ctx context.Context, jobID string, targetHostname string, ) (*CreateJobResult, error)
RetryJob creates a job with the operation of another, in a job.retry span.
func (*Client) SetAgentConfig ¶ added in v0.3.0
func (c *Client) SetAgentConfig( ctx context.Context, machineID string, set job.AgentConfig, ) (job.AgentConfig, error)
SetAgentConfig sets the labels, the max jobs, the log level and the facts interval of set as the config of the agent with machineID, as its next version, in an agent.config.set span.
func (*Client) SetAgentKeyStore ¶
func (c *Client) SetAgentKeyStore( store AgentKeyStore, )
SetAgentKeyStore wires the store used to verify agent responses. See the JobClient interface for why this is separate from construction. With nil, the job client refuses each response of an agent and trusts no registration.
func (*Client) SetAudit ¶ added in v0.3.0
SetAudit wires the audit log. See the JobClient interface.
func (*Client) SetDrainFlag ¶
SetDrainFlag writes the drain flag for an agent in the state KV bucket. The agent detects this flag on heartbeat and stops accepting jobs. Callers pass a machine ID (hex string, no sanitization needed).
func (*Client) SetMachineID ¶
SetMachineID records the identity stamped on payloads this client signs.
func (*Client) SetMeterProvider ¶
func (c *Client) SetMeterProvider( mp *sdkmetric.MeterProvider, )
SetMeterProvider creates OTEL instruments for job metrics.
func (*Client) SetPKISigner ¶
SetPKISigner wires the signer used to sign outgoing job and response payloads and to verify incoming ones. See the JobClient interface for why this is separate from construction. With nil, the job client writes no job and no response, and reads no job record.
func (*Client) WriteAgentSeen ¶ added in v0.3.0
WriteAgentSeen records now as when the agent with machineID last reported.
func (*Client) WriteAgentTimelineEvent ¶
func (c *Client) WriteAgentTimelineEvent( ctx context.Context, machineID, hostname, event, message string, ) error
WriteAgentTimelineEvent writes an append-only timeline event for an agent state transition, under the agent's machine ID, which a rename does not change. The event keeps the hostname that the agent had then.
func (*Client) WriteJobResponse ¶
func (c *Client) WriteJobResponse( ctx context.Context, jobID, hostname string, responseData []byte, status types.AgentJobStatus, errorMsg string, errorCode job.ErrorCode, changed *bool, steps []types.Step, ) error
WriteJobResponse stores agent response data for a job.
func (*Client) WriteStatusEvent ¶
func (c *Client) WriteStatusEvent( ctx context.Context, jobID string, event types.AgentJobStatus, hostname string, data map[string]interface{}, ) error
WriteStatusEvent writes an append-only status event for a job. This eliminates race conditions by never updating existing keys.
type Connection ¶ added in v0.3.0
type Connection struct {
// NATS is the connection.
NATS *natsclient.Client
// Jobs is the job client.
Jobs *Client
// JobsBucket is the KV bucket of the jobs.
JobsBucket string
// RegistryBucket is the KV bucket where each component registers.
RegistryBucket string
// FactsBucket is the KV bucket of the agent facts, or "" if cfg names
// none.
FactsBucket string
// StateBucket is the KV bucket of the agent state, or "" if cfg names
// none.
StateBucket string
}
Connection is a NATS connection with a job client and the buckets that the job client uses. The controller and the agent each make one.
func Connect ¶ added in v0.3.0
func Connect( ctx context.Context, log *slog.Logger, conn config.NATSConnection, cfg config.NATS, timeout time.Duration, resolve func(ctx context.Context, target string) string, mp *sdkmetric.MeterProvider, ) (*Connection, error)
Connect connects to NATS as conn tells, opens the buckets that cfg names, and makes a job client on them. A job waits for its answers for at most timeout. resolve gives the value that a target has in a subject. The metrics of each call to NATS go to mp, the meter provider of the component, which can be nil.
type ConsumerStore ¶ added in v0.3.0
type ConsumerStore interface {
Consumer(ctx context.Context, stream string, consumer string) (jetstream.Consumer, error)
DeleteConsumer(ctx context.Context, stream string, consumer string) error
}
ConsumerStore looks up and removes a JetStream consumer. The JetStream API of a *natsclient.Client (its ExtJS) is one.
type CreateJobResult ¶
type CreateJobResult struct {
JobID string `json:"job_id"`
Status types.JobStatus `json:"status"`
Revision uint64 `json:"revision"`
Timestamp string `json:"timestamp"`
}
CreateJobResult represents the result of creating a job.
type JobClient ¶
type JobClient interface {
// Generic dispatch operations — used by API handlers to submit jobs
// without importing typed wrapper methods.
Query(
ctx context.Context,
target string,
category string,
operation job.OperationType,
data any,
) (string, *job.Response, error)
QueryBroadcast(
ctx context.Context,
target string,
category string,
operation job.OperationType,
data any,
) (string, map[string]*job.Response, error)
Modify(
ctx context.Context,
target string,
category string,
operation job.OperationType,
data any,
) (string, *job.Response, error)
ModifyBroadcast(
ctx context.Context,
target string,
category string,
operation job.OperationType,
data any,
) (string, map[string]*job.Response, error)
// Job queue management operations
GetQueueSummary(
ctx context.Context,
) (*job.QueueStats, error)
GetJobStatus(
ctx context.Context,
jobID string,
) (*job.QueuedJob, error)
ListJobs(
ctx context.Context,
statusFilter types.JobStatus,
limit int,
offset int,
keep func(target string) bool,
) (*ListJobsResult, error)
// Agent discovery
ListAgents(
ctx context.Context,
) ([]job.AgentInfo, error)
GetAgent(
ctx context.Context,
hostname string,
) (*job.AgentInfo, error)
// Agent config, which the controller holds for each agent.
GetAgentConfig(ctx context.Context, machineID string) (job.AgentConfig, error)
SetAgentConfig(
ctx context.Context,
machineID string,
set job.AgentConfig,
) (job.AgentConfig, error)
// ControllerKey is the record of the rotation of the controller's key,
// which each agent follows at its heartbeat.
ControllerKey(ctx context.Context) (pki.ControllerKeyRecord, bool, error)
// NATSCert is the record of the rotation of the NATS server's
// certificate, and false when there is none.
NATSCert(ctx context.Context) (pki.CertRecord, bool, error)
// Agent timeline
WriteAgentTimelineEvent(
ctx context.Context,
machineID, hostname, event, message string,
) error
GetAgentTimeline(
ctx context.Context,
machineID string,
hostname string,
) ([]job.TimelineEvent, error)
// Agent last seen, for admission: an admitted agent that is offline
// keeps when it last reported, which its registry entry does not.
WriteAgentSeen(
ctx context.Context,
machineID string,
) error
AgentsLastSeen(
ctx context.Context,
) (map[string]time.Time, error)
// Agent drain flag
CheckDrainFlag(
ctx context.Context,
hostname string,
) bool
SetDrainFlag(
ctx context.Context,
hostname string,
) error
DeleteDrainFlag(
ctx context.Context,
hostname string,
) error
// Job deletion
DeleteJob(
ctx context.Context,
jobID string,
) error
// Job retry
ListDeadLetters(ctx context.Context, limit int) ([]job.DeadLetter, int, error)
RetryJob(
ctx context.Context,
jobID string,
targetHostname string,
) (*CreateJobResult, error)
// Agent operations - used by agents for processing
// HasJobResponse reports whether this agent has already recorded a
// response for the given job. Used to detect a redelivered message
// for a job this agent has already executed, so the operation is not
// run a second time.
HasJobResponse(
ctx context.Context,
jobID string,
hostname string,
) (bool, error)
WriteStatusEvent(
ctx context.Context,
jobID string,
event types.AgentJobStatus,
hostname string,
data map[string]interface{},
) error
WriteJobResponse(
ctx context.Context,
jobID string,
hostname string,
responseData []byte,
status types.AgentJobStatus,
errorMsg string,
errorCode job.ErrorCode,
changed *bool,
steps []types.Step,
) error
ConsumeJobs(
ctx context.Context,
streamName string,
consumerName string,
handler natsclient.JetStreamMessageHandler,
opts *natsclient.ConsumeOptions,
) error
GetJobData(
ctx context.Context,
jobKey string,
) ([]byte, error)
CreateOrUpdateConsumer(
ctx context.Context,
streamName string,
consumerConfig jetstream.ConsumerConfig,
) error
// SetPKISigner wires the signer used to sign outgoing job and response
// payloads and to verify incoming ones. The keypair a signer needs is
// not always available at client construction time, so this is called
// once one is: on the controller when the enrollment watcher loads the
// controller keypair, and on the agent when PKI enrollment loads the
// agent keypair. Until then, or with nil, the job client writes no job
// and no response, and reads no job record.
SetPKISigner(
signer PKISigner,
)
// SetAgentKeyStore wires the store used to verify agent responses. Like
// the signer, it is not available at construction: on the controller it
// arrives with the enrollment watcher. Until then, or with nil, the job
// client refuses each response of an agent.
SetAgentKeyStore(
store AgentKeyStore,
)
// SetAudit wires the audit log, where the client records a change that
// no request made, such as a hostname that an agent reported. With nil,
// it records none.
SetAudit(
w audit.Writer,
)
// SetMachineID records the identity stamped on payloads this client
// signs, so the verifier knows which stored key to check them against.
// Set on the agent once its identity is resolved; empty on the
// controller, whose payloads agents verify against the controller key.
SetMachineID(
machineID string,
)
}
JobClient defines the interface for interacting with the jobs system.
type ListJobsResult ¶
type ListJobsResult struct {
Jobs []*job.QueuedJob
TotalCount int
StatusCounts map[types.JobStatus]int
}
ListJobsResult represents the result of listing jobs with pagination.
type NATSClient ¶
type NATSClient interface {
Publish(ctx context.Context, subject string, data []byte) error
StreamInfo(ctx context.Context, name string) (*jetstream.StreamInfo, error)
StreamGetMsg(ctx context.Context, name string, seq uint64) (*jetstream.RawStreamMsg, error)
ConsumerCreateOrUpdate(
ctx context.Context,
stream string,
config jetstream.ConsumerConfig,
) error
Consume(
ctx context.Context,
stream string,
consumer string,
handler natsclient.JetStreamMessageHandler,
opts *natsclient.ConsumeOptions,
) error
KVGet(ctx context.Context, bucket string, key string) (jetstream.KeyValueEntry, error)
KVPut(ctx context.Context, bucket string, key string, value []byte) (uint64, error)
KVDelete(ctx context.Context, bucket string, key string) error
KVKeys(ctx context.Context, bucket string, filters ...string) ([]string, error)
KVWatch(
ctx context.Context,
bucket string,
pattern string,
opts ...jetstream.WatchOpt,
) (<-chan jetstream.KeyValueEntry, error)
}
NATSClient is the access to NATS that the job client uses. A *natsclient.Client is one.
type Options ¶
type Options struct {
// Timeout for waiting for job responses (default: 30s)
Timeout time.Duration
// JobsBucket is the KV bucket of the jobs and their responses (required).
JobsBucket string
// RegistryBucket is the KV bucket of the registry.
RegistryBucket string
// FactsBucket is the KV bucket of the agent facts.
FactsBucket string
// StateBucket is the KV bucket of the agent state.
StateBucket string
// StreamName is the JetStream stream name (used to derive DLQ name).
StreamName string
// PKISigner signs job payloads. Nil until SetPKISigner.
PKISigner PKISigner
// TargetResolver resolves hostname targets to machine IDs for NATS
// subject routing. When nil, targets are used as-is.
TargetResolver func(ctx context.Context, target string) string
// Consumers looks up and removes a consumer, so CreateOrUpdateConsumer
// can make again a consumer whose deliver policy changed. When nil, a
// refused update is returned as is.
Consumers ConsumerStore
}
Options configures the jobs client.
type PKISigner ¶
type PKISigner interface {
// Sign signs the given data with the signer's private key.
Sign(data []byte) []byte
// Fingerprint returns the SHA256 fingerprint of the signer's public key.
Fingerprint() string
// ControllerPublicKey returns the controller's public key for verifying
// controller-signed messages. Returns nil if not set.
ControllerPublicKey() ed25519.PublicKey
}
PKISigner signs and verifies payloads. Nil until the controller, or the agent at enrollment, sets it.
type RefusedError ¶ added in v0.3.0
RefusedError is a response whose signature is not the key that the controller admitted for its machine. Hostname is the name recorded at the admission, not the one the response claims.
func (*RefusedError) Error ¶ added in v0.3.0
func (e *RefusedError) Error() string
func (*RefusedError) Unwrap ¶ added in v0.3.0
func (e *RefusedError) Unwrap() error