// Operation initializes a new backend.Operation struct.
//
// This prepares the operation. After calling this, the caller is expected
// to modify fields of the operation such as Sequence to specify what will
// be called.
Operation initializes a new backend.Operation struct.

This prepares the operation. After calling this, the caller is expected
to modify fields of the operation such as Sequence to specify what will
be called.
// Operation initializes a new backend . Operation struct . // // This prepares the operation . After calling this the caller is expected // to modify fields of the operation such as Sequence to specify what will // be called .
func (m *Meta) Operation(b backend.Backend) *backend.Operation {
	schema := b.ConfigSchema()
	workspace, err := m.Workspace()
	if err != nil {
		panic(fmt.Sprintf("invalid workspace: %s", err))
	}
	planOutBackend, err := m.backendState.ForPlan(schema, workspace)
	if err != nil {
		panic(fmt.Sprintf("failed to encode backend configuration for plan: %s", err))
	}
	return &backend.Operation{
		PlanOutBackend:   planOutBackend,
		Parallelism:      m.parallelism,
		Targets:          m.targets,
		UIIn:             m.UIInput(),
		UIOut:            m.Ui,
		Workspace:        workspace,
		LockState:        m.stateLock,
		StateLockTimeout: m.stateLockTimeout,
	}
}
func ( m * Meta ) Operation ( b backend . Backend ) * backend . Operation { schema := b . ConfigSchema ( ) workspace , err := m . Workspace ( ) if err != nil { panic ( fmt . Sprintf ( " " , err ) ) } planOutBackend , err := m . backendState . ForPlan ( schema , workspace ) if err != nil { panic ( fmt . Sprintf ( " " , err ) ) } return & backend . Operation { PlanOutBackend : planOutBackend , Parallelism : m . parallelism , Targets : m . targets , UIIn : m . UIInput ( ) , UIOut : m . Ui , Workspace : workspace , LockState : m . stateLock , StateLockTimeout : m . stateLockTimeout , } }
Operation initializes a new backend.Operation struct.
Operation initializes a new backend . Operation struct .
// An invalid workspace error would have been raised when creating the // backend, and the caller should have already exited. Seeing the error // here first is a bug, so panic. // Always indicates an implementation error in practice, because // errors here indicate invalid encoding of the backend configuration // in memory, and we should always have validated that by the time // we get here.