Documentation
¶
Index ¶
- Variables
- func NewClient(ctx context.Context, gaeProject, subscriptionName string) (*pubsub.Subscription, error)
- func Subscribe(ctx context.Context, sub pubsubReceiver, messageProcessor ProcessPubsubMessage) error
- func WithObserver(ctx context.Context, o observer) context.Context
- type ProcessPubsubMessage
- type SourceRepoEvent
- func (*SourceRepoEvent) Descriptor() ([]byte, []int)deprecated
- func (x *SourceRepoEvent) GetCreateRepoEvent() *SourceRepoEvent_CreateRepoEvent
- func (x *SourceRepoEvent) GetDeleteRepoEvent() *SourceRepoEvent_DeleteRepoEvent
- func (m *SourceRepoEvent) GetEvent() isSourceRepoEvent_Event
- func (x *SourceRepoEvent) GetEventTime() string
- func (x *SourceRepoEvent) GetName() string
- func (x *SourceRepoEvent) GetRefUpdateEvent() *SourceRepoEvent_RefUpdateEvent
- func (x *SourceRepoEvent) GetUrl() string
- func (*SourceRepoEvent) ProtoMessage()
- func (x *SourceRepoEvent) ProtoReflect() protoreflect.Message
- func (x *SourceRepoEvent) Reset()
- func (x *SourceRepoEvent) String() string
- type SourceRepoEvent_CreateRepoEvent
- func (*SourceRepoEvent_CreateRepoEvent) Descriptor() ([]byte, []int)deprecated
- func (*SourceRepoEvent_CreateRepoEvent) ProtoMessage()
- func (x *SourceRepoEvent_CreateRepoEvent) ProtoReflect() protoreflect.Message
- func (x *SourceRepoEvent_CreateRepoEvent) Reset()
- func (x *SourceRepoEvent_CreateRepoEvent) String() string
- type SourceRepoEvent_CreateRepoEvent_
- type SourceRepoEvent_DeleteRepoEvent
- func (*SourceRepoEvent_DeleteRepoEvent) Descriptor() ([]byte, []int)deprecated
- func (*SourceRepoEvent_DeleteRepoEvent) ProtoMessage()
- func (x *SourceRepoEvent_DeleteRepoEvent) ProtoReflect() protoreflect.Message
- func (x *SourceRepoEvent_DeleteRepoEvent) Reset()
- func (x *SourceRepoEvent_DeleteRepoEvent) String() string
- type SourceRepoEvent_DeleteRepoEvent_
- type SourceRepoEvent_RefUpdateEvent
- func (*SourceRepoEvent_RefUpdateEvent) Descriptor() ([]byte, []int)deprecated
- func (x *SourceRepoEvent_RefUpdateEvent) GetEmail() string
- func (x *SourceRepoEvent_RefUpdateEvent) GetRefUpdates() map[string]*SourceRepoEvent_RefUpdateEvent_RefUpdate
- func (*SourceRepoEvent_RefUpdateEvent) ProtoMessage()
- func (x *SourceRepoEvent_RefUpdateEvent) ProtoReflect() protoreflect.Message
- func (x *SourceRepoEvent_RefUpdateEvent) Reset()
- func (x *SourceRepoEvent_RefUpdateEvent) String() string
- type SourceRepoEvent_RefUpdateEvent_
- type SourceRepoEvent_RefUpdateEvent_RefUpdate
- func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetNewId() string
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetOldId() string
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetRefName() string
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetUpdateType() SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType
- func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoMessage()
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoReflect() protoreflect.Message
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) Reset()
- func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) String() string
- type SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType
- func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Descriptor() protoreflect.EnumDescriptor
- func (x SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Enum() *SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType
- func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) EnumDescriptor() ([]byte, []int)deprecated
- func (x SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Number() protoreflect.EnumNumber
- func (x SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) String() string
- func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType_name = map[int32]string{ 0: "UPDATE_TYPE_UNSPECIFIED", 1: "CREATE", 2: "UPDATE_FAST_FORWARD", 3: "UPDATE_NON_FAST_FORWARD", 4: "DELETE", } SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType_value = map[string]int32{ "UPDATE_TYPE_UNSPECIFIED": 0, "CREATE": 1, "UPDATE_FAST_FORWARD": 2, "UPDATE_NON_FAST_FORWARD": 3, "DELETE": 4, } )
Enum value maps for SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType.
var File_backend_pubsub_source_repo_event_proto protoreflect.FileDescriptor
Functions ¶
func NewClient ¶
func NewClient(ctx context.Context, gaeProject, subscriptionName string) (*pubsub.Subscription, error)
NewClient initializes pubsub subscription.
Types ¶
type ProcessPubsubMessage ¶
type ProcessPubsubMessage func(context.Context, *SourceRepoEvent) error
ProcessPubsubMessage handles SourceRepoEvent pubsub message. If error is nil, the original message is acked and removed. Otherwise, the message will be available for consumptions again.
func Processor ¶
func Processor(host *config.Host) ProcessPubsubMessage
Processor returns function which is called each time there is a new SourceRepoEvent.
type SourceRepoEvent ¶
type SourceRepoEvent struct { // The name of the repo that has changed. Values are of the form // `projects/<project>/repos/<repo>`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // URL to clone the repository from Google Cloud Source Repositories. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // The timestamp that this event happened. EventTime string `protobuf:"bytes,3,opt,name=event_time,json=eventTime,proto3" json:"event_time,omitempty"` // The detail data of the event. // // Types that are assignable to Event: // *SourceRepoEvent_RefUpdateEvent_ // *SourceRepoEvent_CreateRepoEvent_ // *SourceRepoEvent_DeleteRepoEvent_ Event isSourceRepoEvent_Event `protobuf_oneof:"event"` // contains filtered or unexported fields }
Cloud Pub/Sub message payload for all events in Source Repo API.
func (*SourceRepoEvent) Descriptor
deprecated
func (*SourceRepoEvent) Descriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent.ProtoReflect.Descriptor instead.
func (*SourceRepoEvent) GetCreateRepoEvent ¶
func (x *SourceRepoEvent) GetCreateRepoEvent() *SourceRepoEvent_CreateRepoEvent
func (*SourceRepoEvent) GetDeleteRepoEvent ¶
func (x *SourceRepoEvent) GetDeleteRepoEvent() *SourceRepoEvent_DeleteRepoEvent
func (*SourceRepoEvent) GetEvent ¶
func (m *SourceRepoEvent) GetEvent() isSourceRepoEvent_Event
func (*SourceRepoEvent) GetEventTime ¶
func (x *SourceRepoEvent) GetEventTime() string
func (*SourceRepoEvent) GetName ¶
func (x *SourceRepoEvent) GetName() string
func (*SourceRepoEvent) GetRefUpdateEvent ¶
func (x *SourceRepoEvent) GetRefUpdateEvent() *SourceRepoEvent_RefUpdateEvent
func (*SourceRepoEvent) GetUrl ¶
func (x *SourceRepoEvent) GetUrl() string
func (*SourceRepoEvent) ProtoMessage ¶
func (*SourceRepoEvent) ProtoMessage()
func (*SourceRepoEvent) ProtoReflect ¶
func (x *SourceRepoEvent) ProtoReflect() protoreflect.Message
func (*SourceRepoEvent) Reset ¶
func (x *SourceRepoEvent) Reset()
func (*SourceRepoEvent) String ¶
func (x *SourceRepoEvent) String() string
type SourceRepoEvent_CreateRepoEvent ¶
type SourceRepoEvent_CreateRepoEvent struct {
// contains filtered or unexported fields
}
An event that created a repository.
func (*SourceRepoEvent_CreateRepoEvent) Descriptor
deprecated
func (*SourceRepoEvent_CreateRepoEvent) Descriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent_CreateRepoEvent.ProtoReflect.Descriptor instead.
func (*SourceRepoEvent_CreateRepoEvent) ProtoMessage ¶
func (*SourceRepoEvent_CreateRepoEvent) ProtoMessage()
func (*SourceRepoEvent_CreateRepoEvent) ProtoReflect ¶
func (x *SourceRepoEvent_CreateRepoEvent) ProtoReflect() protoreflect.Message
func (*SourceRepoEvent_CreateRepoEvent) Reset ¶
func (x *SourceRepoEvent_CreateRepoEvent) Reset()
func (*SourceRepoEvent_CreateRepoEvent) String ¶
func (x *SourceRepoEvent_CreateRepoEvent) String() string
type SourceRepoEvent_CreateRepoEvent_ ¶
type SourceRepoEvent_CreateRepoEvent_ struct {
CreateRepoEvent *SourceRepoEvent_CreateRepoEvent `protobuf:"bytes,5,opt,name=create_repo_event,json=createRepoEvent,proto3,oneof"`
}
type SourceRepoEvent_DeleteRepoEvent ¶
type SourceRepoEvent_DeleteRepoEvent struct {
// contains filtered or unexported fields
}
An event that deleted a repository.
func (*SourceRepoEvent_DeleteRepoEvent) Descriptor
deprecated
func (*SourceRepoEvent_DeleteRepoEvent) Descriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent_DeleteRepoEvent.ProtoReflect.Descriptor instead.
func (*SourceRepoEvent_DeleteRepoEvent) ProtoMessage ¶
func (*SourceRepoEvent_DeleteRepoEvent) ProtoMessage()
func (*SourceRepoEvent_DeleteRepoEvent) ProtoReflect ¶
func (x *SourceRepoEvent_DeleteRepoEvent) ProtoReflect() protoreflect.Message
func (*SourceRepoEvent_DeleteRepoEvent) Reset ¶
func (x *SourceRepoEvent_DeleteRepoEvent) Reset()
func (*SourceRepoEvent_DeleteRepoEvent) String ¶
func (x *SourceRepoEvent_DeleteRepoEvent) String() string
type SourceRepoEvent_DeleteRepoEvent_ ¶
type SourceRepoEvent_DeleteRepoEvent_ struct {
DeleteRepoEvent *SourceRepoEvent_DeleteRepoEvent `protobuf:"bytes,6,opt,name=delete_repo_event,json=deleteRepoEvent,proto3,oneof"`
}
type SourceRepoEvent_RefUpdateEvent ¶
type SourceRepoEvent_RefUpdateEvent struct { // The user who performed the ref updates. Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` // Updates on references, keyed by the names of the references. RefUpdates map[string]*SourceRepoEvent_RefUpdateEvent_RefUpdate `` /* 179-byte string literal not displayed */ // contains filtered or unexported fields }
An event that changed references.
func (*SourceRepoEvent_RefUpdateEvent) Descriptor
deprecated
func (*SourceRepoEvent_RefUpdateEvent) Descriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent_RefUpdateEvent.ProtoReflect.Descriptor instead.
func (*SourceRepoEvent_RefUpdateEvent) GetEmail ¶
func (x *SourceRepoEvent_RefUpdateEvent) GetEmail() string
func (*SourceRepoEvent_RefUpdateEvent) GetRefUpdates ¶
func (x *SourceRepoEvent_RefUpdateEvent) GetRefUpdates() map[string]*SourceRepoEvent_RefUpdateEvent_RefUpdate
func (*SourceRepoEvent_RefUpdateEvent) ProtoMessage ¶
func (*SourceRepoEvent_RefUpdateEvent) ProtoMessage()
func (*SourceRepoEvent_RefUpdateEvent) ProtoReflect ¶
func (x *SourceRepoEvent_RefUpdateEvent) ProtoReflect() protoreflect.Message
func (*SourceRepoEvent_RefUpdateEvent) Reset ¶
func (x *SourceRepoEvent_RefUpdateEvent) Reset()
func (*SourceRepoEvent_RefUpdateEvent) String ¶
func (x *SourceRepoEvent_RefUpdateEvent) String() string
type SourceRepoEvent_RefUpdateEvent_ ¶
type SourceRepoEvent_RefUpdateEvent_ struct {
RefUpdateEvent *SourceRepoEvent_RefUpdateEvent `protobuf:"bytes,4,opt,name=ref_update_event,json=refUpdateEvent,proto3,oneof"`
}
type SourceRepoEvent_RefUpdateEvent_RefUpdate ¶
type SourceRepoEvent_RefUpdateEvent_RefUpdate struct { // The name of the reference. Values are of the form `refs/...` (e.g. // `refs/heads/master`). RefName string `protobuf:"bytes,1,opt,name=ref_name,json=refName,proto3" json:"ref_name,omitempty"` // The type of the update. UpdateType SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType `` /* 156-byte string literal not displayed */ // The previous object ID that the ref pointed to. OldId string `protobuf:"bytes,3,opt,name=old_id,json=oldId,proto3" json:"old_id,omitempty"` // The new object ID that the ref points to. NewId string `protobuf:"bytes,4,opt,name=new_id,json=newId,proto3" json:"new_id,omitempty"` // contains filtered or unexported fields }
An update on a reference.
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) Descriptor
deprecated
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) Descriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent_RefUpdateEvent_RefUpdate.ProtoReflect.Descriptor instead.
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) GetNewId ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetNewId() string
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) GetOldId ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetOldId() string
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) GetRefName ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetRefName() string
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) GetUpdateType ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) GetUpdateType() SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoMessage ¶
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoMessage()
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoReflect ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) ProtoReflect() protoreflect.Message
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) Reset ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) Reset()
func (*SourceRepoEvent_RefUpdateEvent_RefUpdate) String ¶
func (x *SourceRepoEvent_RefUpdateEvent_RefUpdate) String() string
type SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType ¶
type SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType int32
The type of the update.
const ( SourceRepoEvent_RefUpdateEvent_RefUpdate_UPDATE_TYPE_UNSPECIFIED SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType = 0 // Create a new ref. SourceRepoEvent_RefUpdateEvent_RefUpdate_CREATE SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType = 1 // Update the object that the ref points to. SourceRepoEvent_RefUpdateEvent_RefUpdate_UPDATE_FAST_FORWARD SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType = 2 // Update the object that the ref points to forcibly. SourceRepoEvent_RefUpdateEvent_RefUpdate_UPDATE_NON_FAST_FORWARD SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType = 3 // Delete the ref. SourceRepoEvent_RefUpdateEvent_RefUpdate_DELETE SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType = 4 )
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Descriptor ¶
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Descriptor() protoreflect.EnumDescriptor
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) EnumDescriptor
deprecated
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) EnumDescriptor() ([]byte, []int)
Deprecated: Use SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType.Descriptor instead.
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Number ¶
func (x SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) Number() protoreflect.EnumNumber
func (SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) String ¶
func (x SourceRepoEvent_RefUpdateEvent_RefUpdate_UpdateType) String() string