3
0

Rename generated interfaces (for easier ext.)

This commit is contained in:
Denis Arh
2020-08-16 14:27:42 +02:00
parent 7ef781d84c
commit 8ac6c17ea8
13 changed files with 88 additions and 42 deletions

View File

@@ -35,6 +35,15 @@ type (
WaitFor(ctx context.Context, ev eventbus.Event) (err error)
Dispatch(ctx context.Context, ev eventbus.Event)
}
// storeInterface wraps generated interfaces to enable extensions
storeInterface interface {
// Include generated interfaces
storeGeneratedInterfaces
// And all additional required functions
// ...
}
)
var (

View File

@@ -2,10 +2,8 @@ package service
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/actionlog.yaml
// - store/compose_charts.yaml
// - store/compose_module_fields.yaml
@@ -13,10 +11,14 @@ package service
// - store/compose_namespaces.yaml
// - store/compose_pages.yaml
// - store/rbac_rules.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
actionlogsStore
composeChartsStore
composeModuleFieldsStore

View File

@@ -30,6 +30,15 @@ type (
ActionLog options.ActionLogOpt
Storage options.StorageOpt
}
// storeInterface wraps generated interfaces to enable extensions
storeInterface interface {
// Include generated interfaces
storeGeneratedInterfaces
// And all additional required functions
// ...
}
)
var (

View File

@@ -2,16 +2,18 @@ package service
// This file is auto-generated.
//
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/actionlog.yaml
// - store/rbac_rules.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// - store/actionlog.yaml
// - store/rbac_rules.yaml
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
actionlogsStore
rbacRulesStore
}

View File

@@ -2,17 +2,19 @@ package {{ .Package }}
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
{{- range .Definitions }}
// - {{ .Source }}
{{- end }}
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
{{ range .Definitions -}}
{{ unpubIdent .Types.Plural }}Store
{{ end }}

View File

@@ -5,6 +5,10 @@ import (
)
type (
storeInterface interface {
storeGeneratedInterfaces
}
Job interface {
Do(ctx context.Context, s storeInterface) error
}

View File

@@ -2,10 +2,8 @@ package bulk
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/actionlog.yaml
// - store/applications.yaml
// - store/compose_charts.yaml
@@ -20,10 +18,14 @@ package bulk
// - store/settings.yaml
// - store/system_attachments.yaml
// - store/users.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
actionlogsStore
applicationsStore
composeChartsStore

View File

@@ -2,10 +2,8 @@ package tests
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/actionlog.yaml
// - store/applications.yaml
// - store/compose_charts.yaml
@@ -20,10 +18,14 @@ package tests
// - store/settings.yaml
// - store/system_attachments.yaml
// - store/users.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
actionlogsStore
applicationsStore
composeChartsStore

View File

@@ -21,10 +21,6 @@ import (
)
type (
db interface {
Transaction(callback func() error) error
}
permissionServicer interface {
accessControlPermissionServicer
Watch(ctx context.Context)
@@ -45,6 +41,16 @@ type (
WaitFor(ctx context.Context, ev eventbus.Event) (err error)
Dispatch(ctx context.Context, ev eventbus.Event)
}
// storeInterface wraps generated interfaces to enable extensions
storeInterface interface {
// Include generated interfaces
storeGeneratedInterfaces
// And all additional required functions
AddRoleMembersByID(context.Context, uint64, ...uint64) error
CountUsers(context.Context, types.UserFilter) (uint, error)
}
)
var (

View File

@@ -2,10 +2,8 @@ package service
// This file is auto-generated.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/actionlog.yaml
// - store/applications.yaml
// - store/credentials.yaml
@@ -15,10 +13,14 @@ package service
// - store/settings.yaml
// - store/system_attachments.yaml
// - store/users.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
actionlogsStore
applicationsStore
credentialsStore

View File

@@ -2,15 +2,17 @@ package compose
// This file is auto-generated.
//
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/rbac_rules.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// - store/rbac_rules.yaml
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
rbacRulesStore
}
)

View File

@@ -2,15 +2,17 @@ package messaging
// This file is auto-generated.
//
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/rbac_rules.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// - store/rbac_rules.yaml
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
rbacRulesStore
}
)

View File

@@ -2,15 +2,17 @@ package system
// This file is auto-generated.
//
// Template: pkg/store_interfaces_joined.gen.go.tpl
// Definitions:
// - store/rbac_rules.yaml
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Definitions file that controls how this file is generated:
// - store/rbac_rules.yaml
type (
// Interface combines interfaces of all supported store interfaces
storeInterface interface {
storeGeneratedInterfaces interface {
rbacRulesStore
}
)