protomappers

package
v0.0.0-...-7ae29b8 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var All = []interface{}{}/* 124 elements not displayed */

All is the list of all mappers as raw function pointers.

View Source
var AllFns []*argmapper.Func
View Source
var WellKnownFns []*argmapper.Func

Functions

func Array

func Array(
	input *vagrant_plugin_sdk.Args_Array,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) ([]interface{}, error)

func ArrayProto

func ArrayProto(
	input []interface{},
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_Array, error)

func Basis

func Basis(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Basis,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Basis, error)

func BasisProto

func BasisProto(
	b core.Basis,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Basis, error)

func Boolean

func Boolean(
	input *wrapperspb.BoolValue,
) bool

func BooleanProto

func BooleanProto(
	input bool,
) *wrapperspb.BoolValue

func BooleanPtr

func BooleanPtr(
	input *wrapperspb.BoolValue,
) *bool

func BooleanPtrProto

func BooleanPtrProto(
	input *bool,
) *wrapperspb.BoolValue

func Box

func Box(ctx context.Context,
	input *vagrant_plugin_sdk.Args_Box,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Box, error)

func BoxCollection

func BoxCollection(ctx context.Context,
	input *vagrant_plugin_sdk.Args_BoxCollection,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.BoxCollection, error)

func BoxCollectionProto

func BoxCollectionProto(
	boxCollection core.BoxCollection,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_BoxCollection, error)

func BoxMetadata

func BoxMetadata(ctx context.Context,
	input *vagrant_plugin_sdk.Args_BoxMetadata,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.BoxMetadata, error)

func BoxMetadataProto

func BoxMetadataProto(
	boxMetadata core.BoxMetadata,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_BoxMetadata, error)

func BoxProto

func BoxProto(
	box core.Box,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Box, error)

func BoxResponse

func BoxResponse(ctx context.Context,
	input *vagrant_plugin_sdk.Target_Machine_BoxResponse,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Box, error)

func BoxResponseProto

func BoxResponseProto(
	box core.Box,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Target_Machine_BoxResponse, error)

func Bytes

func Bytes(
	input *wrapperspb.BytesValue,
) []byte

func BytesProto

func BytesProto(
	input []byte,
) *wrapperspb.BytesValue

func Class

func Class(
	input *vagrant_plugin_sdk.Args_Class,
) types.Class

func ClassProto

func ClassProto(
	input types.Class,
) *vagrant_plugin_sdk.Args_Class

func Command

func Command(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Command,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Command, error)

func CommandProto

func CommandProto(
	c component.Command,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Command, error)

func Communicator

func Communicator(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Communicator,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Communicator, error)

func CommunicatorCommand

func CommunicatorCommand(
	c *vagrant_plugin_sdk.Communicator_Command,
) ([]string, error)

func CommunicatorCommandProto

func CommunicatorCommandProto(
	c []string,
) (*vagrant_plugin_sdk.Communicator_Command, error)

func CommunicatorProto

func CommunicatorProto(
	c component.Communicator,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Communicator, error)

func ConfigData

func ConfigData(
	input *vagrant_plugin_sdk.Args_ConfigData,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*component.ConfigData, error)

func ConfigDataProto

func ConfigDataProto(
	input *component.ConfigData,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_ConfigData, error)

func ConfigDataToFinalize

func ConfigDataToFinalize(
	input *component.ConfigData,
) *component.ConfigFinalize

func ConfigFinalize

func ConfigFinalize(
	input *vagrant_plugin_sdk.Config_Finalize,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*component.ConfigFinalize, error)

func ConfigFinalizeProto

func ConfigFinalizeProto(
	input *component.ConfigFinalize,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Config_Finalize, error)

func ConfigMerge

func ConfigMerge(
	input *vagrant_plugin_sdk.Config_Merge,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*component.ConfigMerge, error)

func ConfigMergeProto

func ConfigMergeProto(
	input *component.ConfigMerge,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Config_Merge, error)

func CorePluginManager

func CorePluginManager(ctx context.Context,
	input *vagrant_plugin_sdk.Args_CorePluginManager,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.CorePluginManager, error)

func CorePluginManagerProto

func CorePluginManagerProto(
	impl core.CorePluginManager,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_CorePluginManager, error)

func Direct

func Direct(
	input *vagrant_plugin_sdk.Args_Direct,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*component.Direct, error)

func DirectProto

func DirectProto(
	input *component.Direct,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_Direct, error)

func Double

func Double(
	input *wrapperspb.DoubleValue,
) float64

func DoubleProto

func DoubleProto(
	input float64,
) *wrapperspb.DoubleValue

func DoublePtr

func DoublePtr(
	input *wrapperspb.DoubleValue,
) *float64

func DoublePtrProto

func DoublePtrProto(
	input *float64,
) *wrapperspb.DoubleValue

func Flags

func Flags(input []*vagrant_plugin_sdk.Command_Flag) (flags []*component.CommandFlag, err error)

func FlagsProto

func FlagsProto(input []*component.CommandFlag) (output []*vagrant_plugin_sdk.Command_Flag, err error)

Flags maps

func Float

func Float(
	input *wrapperspb.FloatValue,
) float32

func FloatProto

func FloatProto(
	input float32,
) *wrapperspb.FloatValue

func FloatPtr

func FloatPtr(
	input *wrapperspb.FloatValue,
) *float32

func FloatPtrProto

func FloatPtrProto(
	input *float32,
) *wrapperspb.FloatValue

func FolderToVagrantfileSyncedFolder

func FolderToVagrantfileSyncedFolder(
	f *core.Folder,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Target_Machine_SyncedFoldersResponse_Folder, error)

func Folders

func Folders(
	input *vagrant_plugin_sdk.Args_Folders,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (result types.Folders, err error)

func FoldersProto

func FoldersProto(
	input types.Folders,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (opts *vagrant_plugin_sdk.Args_Folders, err error)

func Guest

func Guest(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Guest,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Guest, error)

func GuestProto

func GuestProto(
	input component.Guest,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Guest, error)

func Hash

func Hash(
	input *vagrant_plugin_sdk.Args_Hash,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (result map[interface{}]interface{}, err error)

func HashProto

func HashProto(
	input map[interface{}]interface{},
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_Hash, error)

func HclRange

func HclRange(
	input *vagrant_plugin_sdk.Args_Range,
) (*config.Range, error)

func HclRangeProto

func HclRangeProto(
	input *config.Range,
) (*vagrant_plugin_sdk.Args_Range, error)

func Host

func Host(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Host,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Host, error)

func HostProto

func HostProto(
	input component.Host,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Host, error)

func Int32

func Int32(
	input *wrapperspb.Int32Value,
) int32

func Int32Proto

func Int32Proto(
	input int32,
) *wrapperspb.Int32Value

func Int32Ptr

func Int32Ptr(
	input *wrapperspb.Int32Value,
) *int32

func Int32PtrProto

func Int32PtrProto(
	input *int32,
) *wrapperspb.Int32Value

func Int64

func Int64(
	input *wrapperspb.Int64Value,
) int64

func Int64Proto

func Int64Proto(
	input int64,
) *wrapperspb.Int64Value

func Int64Ptr

func Int64Ptr(
	input *wrapperspb.Int64Value,
) *int64

func Int64PtrProto

func Int64PtrProto(
	input *int64,
) *wrapperspb.Int64Value

func JobInfo

JobInfo maps Args.JobInfo to component.JobInfo.

func JobInfoProto

func JobInfoProto(input *component.JobInfo) (*vagrant_plugin_sdk.Args_JobInfo, error)

JobInfoProto

func Logger

func Logger(input *vagrant_plugin_sdk.Args_Logger) hclog.Logger

Logger maps *vagrant_plugin_sdk.Args_Logger to an hclog.Logger

func LoggerProto

func LoggerProto(log hclog.Logger) *vagrant_plugin_sdk.Args_Logger

func MachineProject

func MachineProject(
	m core.Machine,
) (core.Project, error)

func MapKeyInterface

func MapKeyInterface(
	input map[string]interface{},
) map[interface{}]interface{}

func MapKeyString

func MapKeyString(
	input map[interface{}]interface{},
) (map[string]interface{}, error)

func MapToProto

func MapToProto(input map[string]interface{}) (*structpb.Struct, error)

func Options

func Options(
	input *vagrant_plugin_sdk.Args_Options,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (result types.Options, err error)

func OptionsProto

func OptionsProto(
	input types.Options,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (opts *vagrant_plugin_sdk.Args_Options, err error)

func Path

func Path(
	input *vagrant_plugin_sdk.Args_Path,
) path.Path

func PathProto

func PathProto(
	p path.Path,
) *vagrant_plugin_sdk.Args_Path

func Plugin

func Plugin(
	ctx context.Context,
	input *vagrant_plugin_sdk.PluginManager_Plugin,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*core.NamedPlugin, error)

func PluginManager

func PluginManager(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_PluginManager,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.PluginManager, error)

func PluginManagerProto

func PluginManagerProto(
	input core.PluginManager,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_PluginManager, error)

func PluginProto

func PluginProto(
	input *core.NamedPlugin,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.PluginManager_Plugin, error)

func Plugins

func Plugins(
	ctx context.Context,
	input *vagrant_plugin_sdk.PluginManager_PluginsResponse,
	log hclog.Logger,
	internal pluginargs.Internal,
) ([]*core.NamedPlugin, error)

func PluginsProto

func PluginsProto(
	input []*core.NamedPlugin,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.PluginManager_PluginsResponse, error)

func Project

func Project(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Project,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Project, error)

func ProjectProto

func ProjectProto(
	p core.Project,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Project, error)

func ProtoToMap

func ProtoToMap(input *structpb.Struct) (map[string]interface{}, error)

func Provider

func Provider(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Provider,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Provider, error)

func ProviderProto

func ProviderProto(
	t component.Provider,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Provider, error)

func Provisioner

func Provisioner(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Provisioner,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Provisioner, error)

func ProvisionerProto

func ProvisionerProto(
	t component.Provisioner,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Provisioner, error)

func Push

func Push(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Push,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Push, error)

func PushProto

func PushProto(
	c component.Push,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Push, error)

func Range

func Range(
	input *vagrant_plugin_sdk.Args_Range,
) (types.Range, error)

func RangeProto

func RangeProto(
	input types.Range,
) *vagrant_plugin_sdk.Args_Range

func RawRubyValue

func RawRubyValue(
	input *vagrant_plugin_sdk.Config_RawRubyValue,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*types.RawRubyValue, error)

func RawRubyValueProto

func RawRubyValueProto(
	input *types.RawRubyValue,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Config_RawRubyValue, error)

func Seeds

func Seeds(
	input *vagrant_plugin_sdk.Args_Seeds,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*core.Seeds, error)

NOTE: This does not convert the proto back to the Seeds fully. It will only convert the base type, but the contents will remain as any values to prevent large numbers of grpc service/client setups

func SeedsProto

func SeedsProto(
	input *core.Seeds,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_Seeds, error)

func SeedsProtoFull

func SeedsProtoFull(
	input *core.Seeds,
	log hclog.Logger,
	internal pluginargs.Internal,
	ctx context.Context,
) (*vagrant_plugin_sdk.Args_Seeds, error)

func State

func StateBag

func StateBag(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_StateBag,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.StateBag, error)

StateBag maps StateBag proto to core.StateBag.

func StateBagProto

func StateBagProto(
	bag core.StateBag,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_StateBag, error)

func String

func String(
	input *wrapperspb.StringValue,
) string

func StringProto

func StringProto(
	input string,
) *wrapperspb.StringValue

func StringPtr

func StringPtr(
	input *wrapperspb.StringValue,
) *string

func StringPtrProto

func StringPtrProto(
	input *string,
) *wrapperspb.StringValue

func Symbol

func Symbol(
	input *vagrant_plugin_sdk.Args_Symbol,
) types.Symbol

func SymbolProto

func SymbolProto(
	input types.Symbol,
) *vagrant_plugin_sdk.Args_Symbol

func SyncedFolder

func SyncedFolder(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Provider,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.SyncedFolder, error)

func SyncedFolderProto

func SyncedFolderProto(
	s component.SyncedFolder,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_SyncedFolder, error)

func Target

func Target(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Target,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Target, error)

func TargetIndex

func TargetIndex(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_TargetIndex,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.TargetIndex, error)

func TargetIndexProto

func TargetIndexProto(
	t core.TargetIndex,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_TargetIndex, error)

func TargetMachine

func TargetMachine(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Target_Machine,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Machine, error)

func TargetMachineProto

func TargetMachineProto(
	m core.Machine,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Target_Machine, error)

func TargetProject

func TargetProject(
	t core.Target,
) (core.Project, error)

func TargetProto

func TargetProto(
	t core.Target,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Target, error)

func TargetToMachine

func TargetToMachine(
	input core.Target,
) (core.Machine, error)

func TerminalUI

func TerminalUI(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_TerminalUI,
	log hclog.Logger,
	internal pluginargs.Internal,
) (terminal.UI, error)

TerminalUI maps *vagrant_plugin_sdk.Args_TerminalUI to an hclog.TerminalUI

func TerminalUIProto

func TerminalUIProto(
	ui terminal.UI,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_TerminalUI, error)

func Timestamp

func Timestamp(
	input *timestamppb.Timestamp,
) time.Time

func TimestampProto

func TimestampProto(
	input time.Time,
) *timestamppb.Timestamp

func TimestampPtr

func TimestampPtr(
	input *timestamppb.Timestamp,
) *time.Time

func TimestampPtrProto

func TimestampPtrProto(
	input *time.Time,
) *timestamppb.Timestamp

func UInt32

func UInt32(
	input *wrapperspb.UInt32Value,
) uint32

func UInt32Proto

func UInt32Proto(
	input uint32,
) *wrapperspb.UInt32Value

func UInt32Ptr

func UInt32Ptr(
	input *wrapperspb.UInt32Value,
) *uint32

func UInt32PtrProto

func UInt32PtrProto(
	input *uint32,
) *wrapperspb.UInt32Value

func UInt64

func UInt64(
	input *wrapperspb.UInt64Value,
) uint64

func UInt64Proto

func UInt64Proto(
	input uint64,
) *wrapperspb.UInt64Value

func UInt64Ptr

func UInt64Ptr(
	input *wrapperspb.UInt64Value,
) *uint64

func UInt64PtrProto

func UInt64PtrProto(
	input *uint64,
) *wrapperspb.UInt64Value

func Vagrantfile

func Vagrantfile(
	ctx context.Context,
	input *vagrant_plugin_sdk.Args_Vagrantfile,
	log hclog.Logger,
	internal pluginargs.Internal,
) (core.Vagrantfile, error)

func VagrantfileProto

func VagrantfileProto(
	v core.Vagrantfile,
	log hclog.Logger,
	internal pluginargs.Internal,
) (*vagrant_plugin_sdk.Args_Vagrantfile, error)

func ValueToBool

func ValueToBool(
	input *structpb.Value,
) (bool, error)

func ValueToList

func ValueToList(
	input *structpb.Value,
) ([]*structpb.Value, error)

func ValueToNull

func ValueToNull(
	input *structpb.Value,
) (interface{}, error)

func ValueToNumber

func ValueToNumber(
	input *structpb.Value,
) (float64, error)

func ValueToString

func ValueToString(
	input *structpb.Value,
) (string, error)

func ValueToStruct

func ValueToStruct(
	input *structpb.Value,
) (map[string]*structpb.Value, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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