moosh3 / event-gateway

event-gateway normalizes events and publishes them to kubernetes-managed work queue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api-glue

glue relevant apis together

type (    
        // Event is an API endpoint
        Event struct {
            // Event metadata
            EventInfo
            // URI identifier
            URI string `json:"uri" yaml:"uri"`
            // event type
            Type string `json:"type" yaml:"type"`
            // event kind
            Kind string `json:"kind" yaml:"kind"`
        }
        
        // EventInfo holds metadata regarding the endpoint
        EventInfo struct {
            // Endpoint URL
            Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
            // Description 
            Description string `json:"description,omitempty" yaml:"description,omitempty"`
            // Status of current event for event provider (active, error, not active)
            Status string `json:"status,omitempty" yaml:"status,omitempty"`
        }
        
        // Gluer treats all events as the same
        Gluer interface {
            GetEvent(ctx context.Context, event string) (*Event, error)
            GetEvents(ctx context.Context, eventType, kind string) ([]Event, error)
            CreateEvent(ctx context.Context, eventType, kind, secret, context string, values map[string]string) (*Event, error)
            DeleteEvent(ctx context.Context, event, context string) error
        }    
)

About

event-gateway normalizes events and publishes them to kubernetes-managed work queue

License:Apache License 2.0


Languages

Language:Go 81.9%Language:Makefile 18.1%