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 ¶
- func Init()
- func IsPathShouldBeRemoved(path string) bool
- func SetInstance(ctx context.Context) context.Context
- type DuplicatePackageManager
- func (d *DuplicatePackageManager) ClearUniquePkgMap()
- func (d *DuplicatePackageManager) GetImportInfo() atgconstant.ImportInfo
- func (d *DuplicatePackageManager) GetInitBuilder() []string
- func (d *DuplicatePackageManager) GetMiddleBuilder() []string
- func (d *DuplicatePackageManager) GetPkgName(pkgPath string) string
- func (d *DuplicatePackageManager) IsPkgPathExit(pkgPath string) (string, bool)
- func (d *DuplicatePackageManager) LoadOrStoreImportPkg(pkgName, pkgPath string) (string, bool)
- func (d *DuplicatePackageManager) Put(pkgName string, pkgPath string) (string, bool)
- func (d *DuplicatePackageManager) PutAndGet(pkgName string, pkgPath string) (string, string)
- func (d *DuplicatePackageManager) RelativePath() string
- func (d *DuplicatePackageManager) SetImportInfo(temp atgconstant.ImportInfo)
- func (d *DuplicatePackageManager) SetInitBuilder(builder string)
- func (d *DuplicatePackageManager) SetMiddleBuilder(builder string)
- func (d *DuplicatePackageManager) SetRelativePath(value interface{})
- func (d *DuplicatePackageManager) SetRelativeString(path string)
- func (d *DuplicatePackageManager) UniquePkgMapLen() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPathShouldBeRemoved ¶
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