-
Notifications
You must be signed in to change notification settings - Fork 513
API adds context in building blocks. #1601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
// OutputBinding is the interface for an output binding, allowing users to invoke remote systems with optional payloads.
type OutputBinding interface {
Init(metadata Metadata) error
Invoke(req *InvokeRequest) (*InvokeResponse, error)
Operations() []OperationKind
} to // OutputBinding is the interface for an output binding, allowing users to invoke remote systems with optional payloads.
type OutputBinding interface {
Init(metadata Metadata) error
Invoke(ctx context.Context, req *InvokeRequest) (*InvokeResponse, error)
Operations() []OperationKind
} Binding: Change from InputBinding interface. // InputBinding is the interface to define a binding that triggers on incoming events.
type InputBinding interface {
// Init passes connection and properties metadata to the binding implementation
Init(metadata Metadata) error
// Read is a blocking method that triggers the callback function whenever an event arrives
Read(handler func(*ReadResponse) ([]byte, error)) error
} to // InputBinding is the interface to define a binding that triggers on incoming events.
type InputBinding interface {
// Init passes connection and properties metadata to the binding implementation
Init(metadata Metadata) error
// Read is a blocking method that triggers the callback function whenever an event arrives
Read(handler func(context.Context, *ReadResponse) ([]byte, error)) error
}
// Store is an interface to perform operations on store.
type Store interface {
BulkStore
Init(metadata Metadata) error
Features() []Feature
Delete(req *DeleteRequest) error
Get(req *GetRequest) (*GetResponse, error)
Set(req *SetRequest) error
Ping() error
}
// BulkStore is an interface to perform bulk operations on store.
type BulkStore interface {
BulkDelete(req []DeleteRequest) error
BulkGet(req []GetRequest) (bool, []BulkGetResponse, error)
BulkSet(req []SetRequest) error
} to // Store is an interface to perform operations on store.
type Store interface {
BulkStore
Init(metadata Metadata) error
Features() []Feature
Delete(ctx context.Context, req *DeleteRequest) error
Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
Set(ctx context.Context, req *SetRequest) error
Ping(ctx context.Context) error
}
// BulkStore is an interface to perform bulk operations on store.
type BulkStore interface {
BulkDelete(ctx context.Context, req []DeleteRequest) error
BulkGet(ctx context.Context, req []GetRequest) (bool, []BulkGetResponse, error)
BulkSet(ctx context.Context, req []SetRequest) error
} state.query: Change from Querier interface // Querier is an interface to execute queries.
type Querier interface {
Query(req *QueryRequest) (*QueryResponse, error)
} to // Querier is an interface to execute queries.
type Querier interface {
Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error)
} Change from TransactionalStore API // TransactionalStore is an interface for initialization and support multiple transactional requests.
type TransactionalStore interface {
Init(metadata Metadata) error
Multi(request *TransactionalStateRequest) error
} to // TransactionalStore is an interface for initialization and support multiple transactional requests.
type TransactionalStore interface {
Init(metadata Metadata) error
Multi(ctx context.Context, request *TransactionalStateRequest) error
}
// SecretStore is the interface for a component that handles secrets management.
type SecretStore interface {
// Init authenticates with the actual secret store and performs other init operation
Init(metadata Metadata) error
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values
GetSecret(req GetSecretRequest) (GetSecretResponse, error)
// BulkGetSecrets retrieves all secrets in the store and returns a map of decrypted string/string values
BulkGetSecret(req BulkGetSecretRequest) (BulkGetSecretResponse, error)
} to // SecretStore is the interface for a component that handles secrets management.
type SecretStore interface {
// Init authenticates with the actual secret store and performs other init operation
Init(metadata Metadata) error
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values
GetSecret(ctx context.Context, req GetSecretRequest) (GetSecretResponse, error)
// BulkGetSecrets retrieves all secrets in the store and returns a map of decrypted string/string values
BulkGetSecret(ctx context.Context, req BulkGetSecretRequest) (BulkGetSecretResponse, error)
}
// PubSub is the interface for message buses.
type PubSub interface {
Init(metadata Metadata) error
Features() []Feature
Publish(req *PublishRequest) error
Subscribe(req SubscribeRequest, handler Handler) error
Close() error
} to // PubSub is the interface for message buses.
type PubSub interface {
Init(metadata Metadata) error
Features() []Feature
Publish(ctx context.Context, req *PublishRequest) error
Subscribe(ctx context.Context, req SubscribeRequest, handler Handler) error
Close() error
}
// Resolver is the interface of name resolver.
type Resolver interface {
// Init initializes name resolver.
Init(metadata Metadata) error
// ResolveID resolves name to address.
ResolveID(req ResolveRequest) (string, error)
} to // Resolver is the interface of name resolver.
type Resolver interface {
// Init initializes name resolver.
Init(metadata Metadata) error
// ResolveID resolves name to address.
ResolveID(ctx context.Context, req ResolveRequest) (string, error)
} |
Agree, it will bring full link tracking. |
related dapr/dapr#2716 |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions. |
Uh oh!
There was an error while loading. Please reload this page.
Whether the building blocks standard API should add context to transmit timeout mechanism, trace and other information? I think it is very necessary.
I think the way of handling is unfriendly. It is very necessary to add context to the network transmission. At the same time, we can pass the context information to the downstream, so that the entire trace link can be formed with the downstream. a trace link should not be only exist in dapr cluster.
But
component.type= configuration
exists context, API definitions are not consistent.The text was updated successfully, but these errors were encountered: