Documentation ¶
Index ¶
- Variables
- func CloseDB()
- func CreateServer()
- func DeletePipelineAdminEndpoint(w http.ResponseWriter, req *http.Request)
- func DeletePipelineEndpoint(w http.ResponseWriter, req *http.Request)
- func GetDB() *mongo.Client
- func GetEnv(key, fallback string) string
- func GetPipelineEndpoint(w http.ResponseWriter, req *http.Request)
- func GetPipelinesAdminEndpoint(w http.ResponseWriter, req *http.Request)
- func GetPipelinesEndpoint(w http.ResponseWriter, req *http.Request)
- func GetRootEndpoint(w http.ResponseWriter, req *http.Request)
- func InitDB()
- func IntInSlice(a int, list []int) bool
- func Mongo() *mongo.Collection
- func PostPipelineEndpoint(w http.ResponseWriter, req *http.Request)
- func PutPipelineEndpoint(w http.ResponseWriter, req *http.Request)
- func ToJson(resp string) map[string]interface{}
- type Claims
- type DownstreamConfig
- type InputSelection
- type InputTopic
- type LoggerMiddleWare
- type Mapping
- type MockRepo
- func (r *MockRepo) All(userId string, admin bool, args map[string][]string) (pipelines []Pipeline, err error)
- func (r *MockRepo) DeletePipeline(id string, userId string, admin bool) (err error)
- func (r *MockRepo) FindPipeline(id string, userId string) (pipeline Pipeline, err error)
- func (r *MockRepo) InsertPipeline(pipeline Pipeline) (err error)
- func (r *MockRepo) UpdatePipeline(pipeline Pipeline, userId string) (err error)
- type MongoRepo
- func (r *MongoRepo) All(userId string, admin bool, args map[string][]string) (pipelines []Pipeline, err error)
- func (r *MongoRepo) DeletePipeline(id string, userId string, admin bool) (err error)
- func (r *MongoRepo) FindPipeline(id string, userId string) (pipeline Pipeline, err error)
- func (r *MongoRepo) InsertPipeline(pipeline Pipeline) (err error)
- func (r *MongoRepo) UpdatePipeline(pipeline Pipeline, userId string) (err error)
- type Operator
- type Pipeline
- type PipelineRepository
- type PipelineResponse
- type Registry
- func (r *Registry) DeletePipeline(id string, userId string) (Response, error)
- func (r *Registry) DeletePipelineAdmin(id string, userId string) (Response, error)
- func (r *Registry) GetPipeline(id string, userId string) (pipeline Pipeline, err error)
- func (r *Registry) GetPipelines(userId string, args map[string][]string) (pipelines []Pipeline, err error)
- func (r *Registry) GetPipelinesAdmin(userId string, args map[string][]string) (pipelines []Pipeline, err error)
- func (r *Registry) SavePipeline(pipeline Pipeline, userId string) (id uuid.UUID, err error)
- func (r *Registry) UpdatePipeline(pipeline Pipeline, userId string) (id uuid.UUID, err error)
- type Response
- type UpstreamConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var CTX mongo.SessionContext
View Source
var DB *mongo.Client
View Source
var REGISTRY = NewRegistry(NewMongoRepo())
Functions ¶
func CreateServer ¶
func CreateServer()
func DeletePipelineAdminEndpoint ¶
func DeletePipelineAdminEndpoint(w http.ResponseWriter, req *http.Request)
func DeletePipelineEndpoint ¶
func DeletePipelineEndpoint(w http.ResponseWriter, req *http.Request)
func GetPipelineEndpoint ¶
func GetPipelineEndpoint(w http.ResponseWriter, req *http.Request)
func GetPipelinesAdminEndpoint ¶
func GetPipelinesAdminEndpoint(w http.ResponseWriter, req *http.Request)
func GetPipelinesEndpoint ¶
func GetPipelinesEndpoint(w http.ResponseWriter, req *http.Request)
func GetRootEndpoint ¶
func GetRootEndpoint(w http.ResponseWriter, req *http.Request)
func IntInSlice ¶
func Mongo ¶
func Mongo() *mongo.Collection
func PostPipelineEndpoint ¶
func PostPipelineEndpoint(w http.ResponseWriter, req *http.Request)
func PutPipelineEndpoint ¶
func PutPipelineEndpoint(w http.ResponseWriter, req *http.Request)
Types ¶
type Claims ¶
type DownstreamConfig ¶ added in v0.0.4
type InputSelection ¶
type InputSelection struct { InputName string `json:"inputName,omitempty"` // references mapping name AspectId string `json:"aspectId,omitempty"` FunctionId string `json:"functionId,omitempty"` CharacteristicIds []string `json:"characteristicIds,omitempty"` SelectableId string `json:"selectableId,omitempty"` // either device or group. can be used for SNRGY-1172, needed to update devices in group }
type InputTopic ¶
type LoggerMiddleWare ¶
type LoggerMiddleWare struct {
// contains filtered or unexported fields
}
func (*LoggerMiddleWare) ServeHTTP ¶
func (this *LoggerMiddleWare) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MockRepo ¶
type MockRepo struct { }
func NewMockRepo ¶
func NewMockRepo() *MockRepo
func (*MockRepo) DeletePipeline ¶
func (*MockRepo) FindPipeline ¶
func (*MockRepo) InsertPipeline ¶
type MongoRepo ¶
type MongoRepo struct { }
func NewMongoRepo ¶
func NewMongoRepo() *MongoRepo
func (*MongoRepo) DeletePipeline ¶
func (*MongoRepo) FindPipeline ¶
func (*MongoRepo) InsertPipeline ¶
type Operator ¶
type Operator struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` ApplicationId uuid.UUID `json:"applicationId,omitempty"` ImageId string `json:"imageId,omitempty"` DeploymentType string `json:"deploymentType,omitempty"` OperatorId string `json:"operatorId,omitempty"` Config map[string]string `json:"config,omitempty"` OutputTopic string `json:"outputTopic,omitempty"` InputTopics []InputTopic `json:"inputTopics,omitempty"` InputSelections []InputSelection `json:"inputSelections,omitempty"` PersistData bool `json:"persistData,omitempty"` Cost uint `json:"cost"` UpstreamConfig UpstreamConfig `json:"upstream,omitempty"` DownstreamConfig DownstreamConfig `json:"downstream,omitempty"` }
type Pipeline ¶
type Pipeline struct { Id string `bson:"id" json:"id"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` FlowId string `json:"flowId,omitempty"` Image string `json:"image,omitempty"` WindowTime int `json:"windowTime,omitempty"` MergeStrategy string `json:"mergeStrategy,omitempty"` ConsumeAllMessages bool `json:"consumeAllMessages,omitempty"` Metrics bool `json:"metrics,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` UserId string Operators []Operator `json:"operators,omitempty"` }
type PipelineRepository ¶
type PipelineRepository interface { InsertPipeline(pipeline Pipeline) (err error) UpdatePipeline(pipeline Pipeline, userId string) (err error) All(userId string, admin bool, args map[string][]string) (pipelines []Pipeline, err error) FindPipeline(id string, userId string) (pipeline Pipeline, err error) DeletePipeline(id string, userId string, admin bool) (err error) }
type PipelineResponse ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(repository PipelineRepository) *Registry
func (*Registry) DeletePipeline ¶
func (*Registry) DeletePipelineAdmin ¶
func (*Registry) GetPipeline ¶
func (*Registry) GetPipelines ¶
func (*Registry) GetPipelinesAdmin ¶
func (*Registry) SavePipeline ¶
type UpstreamConfig ¶ added in v0.0.4
type UpstreamConfig struct {
Enabled bool
}
Click to show internal directories.
Click to hide internal directories.