...

Package alizer

Overview ▾

Package alizer is a generated GoMock package.

func NewDetectionResult

func NewDetectionResult(typ model.DevfileType, registry api.Registry, appPorts []int, devfileVersion, name string) *api.DetectionResult

type Alizer

type Alizer struct {
    // contains filtered or unexported fields
}

func NewAlizerClient

func NewAlizerClient(registryClient registry.Client) *Alizer

func (*Alizer) DetectFramework

func (o *Alizer) DetectFramework(ctx context.Context, path string) (DetectedFramework, error)

DetectFramework uses the alizer library in order to detect the devfile to use depending on the files in the path

func (*Alizer) DetectName

func (o *Alizer) DetectName(path string) (string, error)

DetectName retrieves the name of the project (if available). If source code is detected: 1. Detect the name (pom.xml for java, package.json for nodejs, etc.) 2. If unable to detect the name, use the directory name

If no source is detected: 1. Use the directory name

Last step. Sanitize the name so it's valid for a component name

Use: import "github.com/redhat-developer/alizer/pkg/apis/recognizer" components, err := recognizer.DetectComponents("./")

In order to detect the name, the name will first try to find out the name based on the program (pom.xml, etc.) but then if not, it will use the dir name.

func (*Alizer) DetectPorts

func (o *Alizer) DetectPorts(path string) ([]int, error)

type Client

type Client interface {
    DetectFramework(ctx context.Context, path string) (DetectedFramework, error)
    DetectName(path string) (string, error)
    DetectPorts(path string) ([]int, error)
}

type DetectedFramework

type DetectedFramework struct {
    Type           model.DevfileType
    DefaultVersion string
    Registry       api.Registry
    Architectures  []string
}

type MockClient

MockClient is a mock of Client interface.

type MockClient struct {
    // contains filtered or unexported fields
}

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) DetectFramework

func (m *MockClient) DetectFramework(ctx context.Context, path string) (DetectedFramework, error)

DetectFramework mocks base method.

func (*MockClient) DetectName

func (m *MockClient) DetectName(path string) (string, error)

DetectName mocks base method.

func (*MockClient) DetectPorts

func (m *MockClient) DetectPorts(path string) ([]int, error)

DetectPorts mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockClientMockRecorder

MockClientMockRecorder is the mock recorder for MockClient.

type MockClientMockRecorder struct {
    // contains filtered or unexported fields
}

func (*MockClientMockRecorder) DetectFramework

func (mr *MockClientMockRecorder) DetectFramework(ctx, path interface{}) *gomock.Call

DetectFramework indicates an expected call of DetectFramework.

func (*MockClientMockRecorder) DetectName

func (mr *MockClientMockRecorder) DetectName(path interface{}) *gomock.Call

DetectName indicates an expected call of DetectName.

func (*MockClientMockRecorder) DetectPorts

func (mr *MockClientMockRecorder) DetectPorts(path interface{}) *gomock.Call

DetectPorts indicates an expected call of DetectPorts.