Skip to content

Commit

Permalink
chore: Add new, optional top level SDK data system configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Sep 23, 2024
1 parent 62eb112 commit 6e16d79
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions servicedef/sdk_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type SDKConfigParams struct {
ClientSide o.Maybe[SDKConfigClientSideParams] `json:"clientSide,omitempty"`
Hooks o.Maybe[SDKConfigHooksParams] `json:"hooks,omitempty"`
Wrapper o.Maybe[SDKConfigWrapper] `json:"wrapper,omitempty"`
DataSystem o.Maybe[SDKConfigDataSystem] `json:"dataSystem,omitempty"`
}

type SDKConfigTLSParams struct {
Expand Down Expand Up @@ -104,3 +105,47 @@ type SDKConfigWrapper struct {
Name string `json:"name"`
Version string `json:"version"`
}

type SDKConfigDataSystem struct {
Synchronizers []SDKConfigDataSystemDataSource `json:"synchronizers,omitempty"`
Initializers []SDKConfigDataSystemDataSource `json:"initializers,omitempty"`
Persistence SDKConfigDataSystemPersistence `json:"persistence,omitempty"`
}

type SDKConfigDataSystemDataSource struct {
Type string `json:"type"`
DataSystemDataSourceConfig
}

type DataSystemDataSourceConfig interface{}

type DataSystemStreamingDataSourceConfig struct {
SDKConfigStreamingParams
}

type DataSystemPollingDataSourceConfig struct {
SDKConfigPollingParams
}

type SDKConfigDataSystemPersistence struct {
Store SDKConfigDataSystemPersistenceStore `json:"store"`
Cache SDKConfigDataSystemPersistenceCache `json:"cache"`
}

type SDKConfigDataSystemPersistenceStore struct {
Type string `json:"type"`
DSN string `json:"dsn"`
}

type SDKConfigDataSystemPersistenceMode string

const (
Off SDKConfigDataSystemPersistenceMode = "off"
TTL SDKConfigDataSystemPersistenceMode = "ttl"
Infinite SDKConfigDataSystemPersistenceMode = "infinite"
)

type SDKConfigDataSystemPersistenceCache struct {
Mode string `json:"mode"`
TTL int `json:"ttl"` // This value is only valid when the Mode is set to TTL. It must be a positive integer.
}

0 comments on commit 6e16d79

Please sign in to comment.