triggers

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyParams

func ApplyParams(jsonObj []byte, params []v1alpha1.TriggerParameter, events map[string]*v1alpha1.Event) ([]byte, error)

ApplyParams applies the params to the resource json object

func ApplyResourceParameters

func ApplyResourceParameters(events map[string]*v1alpha1.Event, parameters []v1alpha1.TriggerParameter, obj *unstructured.Unstructured) error

ApplyResourceParameters applies parameters to K8s resource within trigger

func ApplyTemplateParameters

func ApplyTemplateParameters(events map[string]*v1alpha1.Event, trigger *v1alpha1.Trigger) error

ApplyTemplateParameters applies parameters to trigger template

func ConstructPayload

func ConstructPayload(events map[string]*v1alpha1.Event, parameters []v1alpha1.TriggerParameter) ([]byte, error)

ConstructPayload constructs a payload for operations involving request and responses like HTTP request.

func FetchKubernetesResource

func FetchKubernetesResource(source *v1alpha1.ArtifactLocation) (*unstructured.Unstructured, error)

func GetGroupVersionResource added in v1.5.0

func GetGroupVersionResource(obj *unstructured.Unstructured) schema.GroupVersionResource

func RegisterTriggerServer

func RegisterTriggerServer(s *grpc.Server, srv TriggerServer)

func ResolveParamValue

func ResolveParamValue(src *v1alpha1.TriggerParameterSource, events map[string]*v1alpha1.Event) (*string, string, error)

helper method to resolve the parameter's value from the src returns value and value type (jsonType or stringType or empty string if not found). jsonType represent a block while stringType represent a single value. returns an error if the Path is invalid/not found and the default value is nil OR if the eventDependency event doesn't exist and default value is nil

Types

type ApplyPolicyRequest

type ApplyPolicyRequest struct {
	Request              []byte   `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ApplyPolicyRequest is the request to apply policy on the trigger execution result.

func (*ApplyPolicyRequest) Descriptor

func (*ApplyPolicyRequest) Descriptor() ([]byte, []int)

func (*ApplyPolicyRequest) GetRequest

func (m *ApplyPolicyRequest) GetRequest() []byte

func (*ApplyPolicyRequest) ProtoMessage

func (*ApplyPolicyRequest) ProtoMessage()

func (*ApplyPolicyRequest) Reset

func (m *ApplyPolicyRequest) Reset()

func (*ApplyPolicyRequest) String

func (m *ApplyPolicyRequest) String() string

func (*ApplyPolicyRequest) XXX_DiscardUnknown

func (m *ApplyPolicyRequest) XXX_DiscardUnknown()

func (*ApplyPolicyRequest) XXX_Marshal

func (m *ApplyPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApplyPolicyRequest) XXX_Merge

func (m *ApplyPolicyRequest) XXX_Merge(src proto.Message)

func (*ApplyPolicyRequest) XXX_Size

func (m *ApplyPolicyRequest) XXX_Size() int

func (*ApplyPolicyRequest) XXX_Unmarshal

func (m *ApplyPolicyRequest) XXX_Unmarshal(b []byte) error

type ApplyPolicyResponse

type ApplyPolicyResponse struct {
	Success              bool     `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ApplyPolicyResponse is the response of the application of the trigger policy.

func (*ApplyPolicyResponse) Descriptor

func (*ApplyPolicyResponse) Descriptor() ([]byte, []int)

func (*ApplyPolicyResponse) GetMessage

func (m *ApplyPolicyResponse) GetMessage() string

func (*ApplyPolicyResponse) GetSuccess

func (m *ApplyPolicyResponse) GetSuccess() bool

func (*ApplyPolicyResponse) ProtoMessage

func (*ApplyPolicyResponse) ProtoMessage()

func (*ApplyPolicyResponse) Reset

func (m *ApplyPolicyResponse) Reset()

func (*ApplyPolicyResponse) String

func (m *ApplyPolicyResponse) String() string

func (*ApplyPolicyResponse) XXX_DiscardUnknown

func (m *ApplyPolicyResponse) XXX_DiscardUnknown()

func (*ApplyPolicyResponse) XXX_Marshal

func (m *ApplyPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApplyPolicyResponse) XXX_Merge

func (m *ApplyPolicyResponse) XXX_Merge(src proto.Message)

func (*ApplyPolicyResponse) XXX_Size

func (m *ApplyPolicyResponse) XXX_Size() int

func (*ApplyPolicyResponse) XXX_Unmarshal

func (m *ApplyPolicyResponse) XXX_Unmarshal(b []byte) error

type ExecuteRequest

type ExecuteRequest struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ExecuteRequest is a request to execute a trigger resource.

func (*ExecuteRequest) Descriptor

func (*ExecuteRequest) Descriptor() ([]byte, []int)

func (*ExecuteRequest) GetPayload

func (m *ExecuteRequest) GetPayload() []byte

func (*ExecuteRequest) GetResource

func (m *ExecuteRequest) GetResource() []byte

func (*ExecuteRequest) ProtoMessage

func (*ExecuteRequest) ProtoMessage()

func (*ExecuteRequest) Reset

func (m *ExecuteRequest) Reset()

func (*ExecuteRequest) String

func (m *ExecuteRequest) String() string

func (*ExecuteRequest) XXX_DiscardUnknown

func (m *ExecuteRequest) XXX_DiscardUnknown()

func (*ExecuteRequest) XXX_Marshal

func (m *ExecuteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecuteRequest) XXX_Merge

func (m *ExecuteRequest) XXX_Merge(src proto.Message)

func (*ExecuteRequest) XXX_Size

func (m *ExecuteRequest) XXX_Size() int

func (*ExecuteRequest) XXX_Unmarshal

func (m *ExecuteRequest) XXX_Unmarshal(b []byte) error

type ExecuteResponse

type ExecuteResponse struct {
	Response             []byte   `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ExecuteResponse is the response of the trigger execution

func (*ExecuteResponse) Descriptor

func (*ExecuteResponse) Descriptor() ([]byte, []int)

func (*ExecuteResponse) GetResponse

func (m *ExecuteResponse) GetResponse() []byte

func (*ExecuteResponse) ProtoMessage

func (*ExecuteResponse) ProtoMessage()

func (*ExecuteResponse) Reset

func (m *ExecuteResponse) Reset()

func (*ExecuteResponse) String

func (m *ExecuteResponse) String() string

func (*ExecuteResponse) XXX_DiscardUnknown

func (m *ExecuteResponse) XXX_DiscardUnknown()

func (*ExecuteResponse) XXX_Marshal

func (m *ExecuteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecuteResponse) XXX_Merge

func (m *ExecuteResponse) XXX_Merge(src proto.Message)

func (*ExecuteResponse) XXX_Size

func (m *ExecuteResponse) XXX_Size() int

func (*ExecuteResponse) XXX_Unmarshal

func (m *ExecuteResponse) XXX_Unmarshal(b []byte) error

type FetchResourceRequest

type FetchResourceRequest struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

FetchResourceRequest is the request to fetch trigger resource

func (*FetchResourceRequest) Descriptor

func (*FetchResourceRequest) Descriptor() ([]byte, []int)

func (*FetchResourceRequest) GetResource

func (m *FetchResourceRequest) GetResource() []byte

func (*FetchResourceRequest) ProtoMessage

func (*FetchResourceRequest) ProtoMessage()

func (*FetchResourceRequest) Reset

func (m *FetchResourceRequest) Reset()

func (*FetchResourceRequest) String

func (m *FetchResourceRequest) String() string

func (*FetchResourceRequest) XXX_DiscardUnknown

func (m *FetchResourceRequest) XXX_DiscardUnknown()

func (*FetchResourceRequest) XXX_Marshal

func (m *FetchResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchResourceRequest) XXX_Merge

func (m *FetchResourceRequest) XXX_Merge(src proto.Message)

func (*FetchResourceRequest) XXX_Size

func (m *FetchResourceRequest) XXX_Size() int

func (*FetchResourceRequest) XXX_Unmarshal

func (m *FetchResourceRequest) XXX_Unmarshal(b []byte) error

type FetchResourceResponse

type FetchResourceResponse struct {
	Resource             []byte   `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

FetchResourceRequest contains the fetched resource.

func (*FetchResourceResponse) Descriptor

func (*FetchResourceResponse) Descriptor() ([]byte, []int)

func (*FetchResourceResponse) GetResource

func (m *FetchResourceResponse) GetResource() []byte

func (*FetchResourceResponse) ProtoMessage

func (*FetchResourceResponse) ProtoMessage()

func (*FetchResourceResponse) Reset

func (m *FetchResourceResponse) Reset()

func (*FetchResourceResponse) String

func (m *FetchResourceResponse) String() string

func (*FetchResourceResponse) XXX_DiscardUnknown

func (m *FetchResourceResponse) XXX_DiscardUnknown()

func (*FetchResourceResponse) XXX_Marshal

func (m *FetchResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchResourceResponse) XXX_Merge

func (m *FetchResourceResponse) XXX_Merge(src proto.Message)

func (*FetchResourceResponse) XXX_Size

func (m *FetchResourceResponse) XXX_Size() int

func (*FetchResourceResponse) XXX_Unmarshal

func (m *FetchResourceResponse) XXX_Unmarshal(b []byte) error

type TriggerClient

type TriggerClient interface {
	// FetchResource fetches the resource to be triggered.
	FetchResource(ctx context.Context, in *FetchResourceRequest, opts ...grpc.CallOption) (*FetchResourceResponse, error)
	// Execute executes the requested trigger resource.
	Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
	// ApplyPolicy applies policies on the trigger execution result.
	ApplyPolicy(ctx context.Context, in *ApplyPolicyRequest, opts ...grpc.CallOption) (*ApplyPolicyResponse, error)
}

TriggerClient is the client API for Trigger service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTriggerClient

func NewTriggerClient(cc *grpc.ClientConn) TriggerClient

type TriggerServer

type TriggerServer interface {
	// FetchResource fetches the resource to be triggered.
	FetchResource(context.Context, *FetchResourceRequest) (*FetchResourceResponse, error)
	// Execute executes the requested trigger resource.
	Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
	// ApplyPolicy applies policies on the trigger execution result.
	ApplyPolicy(context.Context, *ApplyPolicyRequest) (*ApplyPolicyResponse, error)
}

TriggerServer is the server API for Trigger service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL