duplicatepackagemanager

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

* Copyright 2022 ByteDance Inc. * * Licensed 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func IsPathShouldBeRemoved

func IsPathShouldBeRemoved(path string) bool

func SetInstance

func SetInstance(ctx context.Context) context.Context

Types

type DuplicatePackageManager

type DuplicatePackageManager struct {
	CurrentPkgName string
	CurrentPkgPath string

	GlobalBuilder []string
	MiddleBuilder []string
	UniquePkgMap  sync.Map          //key:pkg_name,key:pkg_path
	CheckPkgMap   map[string]string //key:pkg_path,key:pkg_name
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance(ctx context.Context) *DuplicatePackageManager

func GetInstanceA

func GetInstanceA() *DuplicatePackageManager

GetInstanceA - get singleton instance pre-initialized

func NewPackageManager

func NewPackageManager() *DuplicatePackageManager

func (*DuplicatePackageManager) ClearUniquePkgMap

func (d *DuplicatePackageManager) ClearUniquePkgMap()

warning: Use with caution

func (*DuplicatePackageManager) GetImportInfo

func (d *DuplicatePackageManager) GetImportInfo() atgconstant.ImportInfo

func (*DuplicatePackageManager) GetInitBuilder

func (d *DuplicatePackageManager) GetInitBuilder() []string

func (*DuplicatePackageManager) GetMiddleBuilder

func (d *DuplicatePackageManager) GetMiddleBuilder() []string

func (*DuplicatePackageManager) GetPkgName

func (d *DuplicatePackageManager) GetPkgName(pkgPath string) string

func (*DuplicatePackageManager) IsPkgPathExit

func (d *DuplicatePackageManager) IsPkgPathExit(pkgPath string) (string, bool)

The bool result is true if the value load or store success, false if fail

func (*DuplicatePackageManager) LoadOrStoreImportPkg

func (d *DuplicatePackageManager) LoadOrStoreImportPkg(pkgName, pkgPath string) (string, bool)

The bool result is true if the value load or store success, false if fail

func (*DuplicatePackageManager) Put

func (d *DuplicatePackageManager) Put(pkgName string, pkgPath string) (string, bool)

func (*DuplicatePackageManager) PutAndGet

func (d *DuplicatePackageManager) PutAndGet(pkgName string, pkgPath string) (string, string)

PutAndGet PkgName are supposed to be not empty. if that's empty, let's parse its pkg name.

func (*DuplicatePackageManager) RelativePath

func (d *DuplicatePackageManager) RelativePath() string

func (*DuplicatePackageManager) SetImportInfo

func (d *DuplicatePackageManager) SetImportInfo(temp atgconstant.ImportInfo)

func (*DuplicatePackageManager) SetInitBuilder

func (d *DuplicatePackageManager) SetInitBuilder(builder string)

func (*DuplicatePackageManager) SetMiddleBuilder

func (d *DuplicatePackageManager) SetMiddleBuilder(builder string)

func (*DuplicatePackageManager) SetRelativePath

func (d *DuplicatePackageManager) SetRelativePath(value interface{})

func (*DuplicatePackageManager) SetRelativeString

func (d *DuplicatePackageManager) SetRelativeString(path string)

func (*DuplicatePackageManager) UniquePkgMapLen

func (d *DuplicatePackageManager) UniquePkgMapLen() int

The bool result is true if the value load or store success, false if fail

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL