Copyright 2019 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Package proxydatasource implements an internal.DataSource backed solely by a proxy instance.
package proxydatasource

import (
	

	
	
	
)
GetUnit returns information about a directory at a path.
func ( *DataSource) ( context.Context,  *internal.UnitMeta,  internal.FieldSet,  internal.BuildContext) ( *internal.Unit,  error) {
	defer derrors.Wrap(&, "GetUnit(%q, %q, %q)", .Path, .ModulePath, .Version)
	return .getUnit(, .Path, .ModulePath, .Version, )
}
GetModuleInfo returns the ModuleInfo as fetched from the proxy for module version specified by modulePath and version.
func ( *DataSource) ( context.Context, ,  string) ( *internal.ModuleInfo,  error) {
	defer derrors.Wrap(&, "GetModuleInfo(%q, %q)", , )
	,  := .getModule(, , , internal.BuildContext{})
	if  != nil {
		return nil, 
	}
	return &.ModuleInfo, nil
}
GetUnitMeta returns information about the given path.
func ( *DataSource) ( context.Context, , ,  string) ( *internal.UnitMeta,  error) {
	defer derrors.Wrap(&, "GetUnitMeta(%q, %q, %q)", , , )

	var  *proxy.VersionInfo
	if  == internal.UnknownModulePath {
		, ,  = .findModule(, , )
		if  != nil {
			return nil, 
		}
		 = .Version
	}
	,  := .getModule(, , , internal.BuildContext{})
	if  != nil {
		return nil, 
	}
	 := &internal.UnitMeta{
		Path: ,
		ModuleInfo: internal.ModuleInfo{
			ModulePath:        ,
			Version:           ,
			IsRedistributable: .IsRedistributable,
		},
	}
	for ,  := range .Units {
		if .Path ==  {
			.Name = .Name
			.IsRedistributable = .IsRedistributable
			break
		}
	}
	return , nil
}
GetExperiments is unimplemented.
GetNestedModules will return an empty slice since it is not implemented in proxy mode.
func ( *DataSource) ( context.Context,  string) ( []*internal.ModuleInfo,  error) {
	return nil, nil
}
GetModuleReadme is unimplemented.
func ( *DataSource) ( context.Context, ,  string) (*internal.Readme, error) {
	return nil, nil