-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c062a7a
commit ae4cc16
Showing
26 changed files
with
1,964 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
pkgadapter "knative.dev/eventing/pkg/adapter/v2" | ||
|
||
"github.com/zeiss/typhoon/pkg/targets/adapter/natstarget" | ||
) | ||
|
||
func main() { | ||
pkgadapter.Main("natstarget", natstarget.EnvAccessorCtor, natstarget.NewTarget) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
"context" | ||
|
||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
|
||
"knative.dev/pkg/apis" | ||
duckv1 "knative.dev/pkg/apis/duck/v1" | ||
|
||
"github.com/zeiss/typhoon/pkg/apis/common/v1alpha1" | ||
) | ||
|
||
// GetGroupVersionKind implements kmeta.OwnerRefable. | ||
func (*NatsTarget) GetGroupVersionKind() schema.GroupVersionKind { | ||
return SchemeGroupVersion.WithKind("KafkaTarget") | ||
} | ||
|
||
// GetConditionSet implements duckv1.KRShaped. | ||
func (*NatsTarget) GetConditionSet() apis.ConditionSet { | ||
return v1alpha1.DefaultConditionSet | ||
} | ||
|
||
// GetStatus implements duckv1.KRShaped. | ||
func (t *NatsTarget) GetStatus() *duckv1.Status { | ||
return &t.Status.Status | ||
} | ||
|
||
// GetStatusManager implements Reconcilable. | ||
func (t *NatsTarget) GetStatusManager() *v1alpha1.StatusManager { | ||
return &v1alpha1.StatusManager{ | ||
ConditionSet: t.GetConditionSet(), | ||
Status: &t.Status, | ||
} | ||
} | ||
|
||
// GetAdapterOverrides implements AdapterConfigurable. | ||
func (t *NatsTarget) GetAdapterOverrides() *v1alpha1.AdapterOverrides { | ||
return t.Spec.AdapterOverrides | ||
} | ||
|
||
// SetDefaults implements apis.Defaultable | ||
func (t *NatsTarget) SetDefaults(ctx context.Context) { | ||
} | ||
|
||
// Validate implements apis.Validatable | ||
func (t *NatsTarget) Validate(ctx context.Context) *apis.FieldError { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"github.com/zeiss/typhoon/pkg/apis/common/v1alpha1" | ||
) | ||
|
||
// +genclient | ||
// +genreconciler | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// NatsTarget is the Schema for an NatsTarget. | ||
type NatsTarget struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec NatsTargetSpec `json:"spec"` | ||
Status v1alpha1.Status `json:"status,omitempty"` | ||
} | ||
|
||
// Check the interfaces the event target should be implementing. | ||
var ( | ||
_ v1alpha1.Reconcilable = (*NatsTarget)(nil) | ||
_ v1alpha1.AdapterConfigurable = (*NatsTarget)(nil) | ||
) | ||
|
||
// NatsTargetSpec defines the desired state of the event target. | ||
type NatsTargetSpec struct { | ||
// Subject where messages are produced. | ||
Subject string `json:"subject"` | ||
|
||
// URL of the Nats server. | ||
URL string `json:"url"` | ||
|
||
// Adapter spec overrides parameters. | ||
// +optional | ||
AdapterOverrides *v1alpha1.AdapterOverrides `json:"adapterOverrides,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// NatsTargetList is a list of event target instances. | ||
type NatsTargetList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
|
||
Items []NatsTarget `json:"items"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
125 changes: 125 additions & 0 deletions
125
...ient/generated/clientset/internalclientset/typed/targets/v1alpha1/fake/fake_natstarget.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
.../generated/clientset/internalclientset/typed/targets/v1alpha1/fake/fake_targets_client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...lient/generated/clientset/internalclientset/typed/targets/v1alpha1/generated_expansion.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.