pkg/bundle/template/visitor/api.go (39 lines of code) (raw):
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package visitor
import (
bundlev1 "github.com/elastic/harp/api/gen/go/harp/bundle/v1"
)
// InfrastructureAcceptor is the contract for visitor entrypoint.
type InfrastructureAcceptor interface {
Accept(InfrastructureVisitor)
}
// PlatformAcceptor is the contract for visitor entrypoint.
type PlatformAcceptor interface {
Accept(PlatformVisitor)
}
// ProductAcceptor is the contract for visitor entrypoint.
type ProductAcceptor interface {
Accept(ProductVisitor)
}
// ApplicationAcceptor is the contract for visitor entrypoint.
type ApplicationAcceptor interface {
Accept(ApplicationVisitor)
}
// InfrastructureVisitor describes visitor method used for tree walk.
type InfrastructureVisitor interface {
Error() error
VisitForProvider(obj *bundlev1.InfrastructureNS)
VisitForRegion(obj *bundlev1.InfrastructureRegionNS)
VisitForService(obj *bundlev1.InfrastructureServiceNS)
}
// PlatformVisitor describes visitor method used for tree walk.
type PlatformVisitor interface {
Error() error
VisitForRegion(obj *bundlev1.PlatformRegionNS)
VisitForComponent(obj *bundlev1.PlatformComponentNS)
}
// ProductVisitor describes visitor method used for tree walk.
type ProductVisitor interface {
Error() error
VisitForComponent(obj *bundlev1.ProductComponentNS)
}
// ApplicationVisitor describes visitor method used for tree walk.
type ApplicationVisitor interface {
Error() error
VisitForComponent(obj *bundlev1.ApplicationComponentNS)
}
// TemplateVisitor is a bundle template visitor.
type TemplateVisitor interface {
Error() error
Visit(*bundlev1.Template)
}