[State Memcached] Adds Component Metadata Schema (#3061)

Signed-off-by: robertojrojas <robertojrojas@gmail.com>
This commit is contained in:
Roberto Rojas 2023-08-10 13:19:19 -04:00 committed by GitHub
parent ff0aef40b1
commit 2baaecd841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 3 deletions

View File

@ -50,9 +50,9 @@ type Memcached struct {
}
type memcachedMetadata struct {
Hosts []string
MaxIdleConnections int
Timeout int
Hosts []string `mapstructure:"hosts"`
MaxIdleConnections int `mapstructure:"maxIdleConnections"`
Timeout int `mapstructure:"timeout"`
}
func NewMemCacheStateStore(logger logger.Logger) state.Store {

View File

@ -0,0 +1,31 @@
# yaml-language-server: $schema=../../component-metadata-schema.json
schemaVersion: v1
type: state
name: memcached
version: v1
status: stable
title: "Memcached"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-memcached/
capabilities:
- crud
- ttl
metadata:
- name: hosts
type: string
required: true
description: |
Comma delimited endpoints
example: '"memcached.default.svc.cluster.local:11211"'
- name: maxIdleConnections
type: number
default: '2'
description: |
The max number of idle connections.
example: '"3"'
- name: timeout
type: duration
description: |
The timeout for the calls. Defaults to "1000ms"
example: '"1000ms"'