192 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			192 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
 | |
| // source: github.com/containerd/containerd/api/events/task.proto
 | |
| package events
 | |
| 
 | |
| import (
 | |
| 	fmt "fmt"
 | |
| )
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskCreate) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	// unhandled: rootfs
 | |
| 	// unhandled: pid
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "bundle":
 | |
| 		return string(m.Bundle), len(m.Bundle) > 0
 | |
| 	case "io":
 | |
| 		// NOTE(stevvooe): This is probably not correct in many cases.
 | |
| 		// We assume that the target message also implements the Field
 | |
| 		// method, which isn't likely true in a lot of cases.
 | |
| 		//
 | |
| 		// If you have a broken build and have found this comment,
 | |
| 		// you may be closer to a solution.
 | |
| 		if m.IO == nil {
 | |
| 			return "", false
 | |
| 		}
 | |
| 		return m.IO.Field(fieldpath[1:])
 | |
| 	case "checkpoint":
 | |
| 		return string(m.Checkpoint), len(m.Checkpoint) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskStart) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	// unhandled: pid
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskDelete) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	// unhandled: pid
 | |
| 	// unhandled: exit_status
 | |
| 	// unhandled: exited_at
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "id":
 | |
| 		return string(m.ID), len(m.ID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskIO) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "stdin":
 | |
| 		return string(m.Stdin), len(m.Stdin) > 0
 | |
| 	case "stdout":
 | |
| 		return string(m.Stdout), len(m.Stdout) > 0
 | |
| 	case "stderr":
 | |
| 		return string(m.Stderr), len(m.Stderr) > 0
 | |
| 	case "terminal":
 | |
| 		return fmt.Sprint(m.Terminal), true
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskExit) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	// unhandled: pid
 | |
| 	// unhandled: exit_status
 | |
| 	// unhandled: exited_at
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "id":
 | |
| 		return string(m.ID), len(m.ID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskOOM) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskExecAdded) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "exec_id":
 | |
| 		return string(m.ExecID), len(m.ExecID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskExecStarted) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	// unhandled: pid
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "exec_id":
 | |
| 		return string(m.ExecID), len(m.ExecID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskPaused) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskResumed) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | |
| 
 | |
| // Field returns the value for the given fieldpath as a string, if defined.
 | |
| // If the value is not defined, the second value will be false.
 | |
| func (m *TaskCheckpointed) Field(fieldpath []string) (string, bool) {
 | |
| 	if len(fieldpath) == 0 {
 | |
| 		return "", false
 | |
| 	}
 | |
| 	switch fieldpath[0] {
 | |
| 	case "container_id":
 | |
| 		return string(m.ContainerID), len(m.ContainerID) > 0
 | |
| 	case "checkpoint":
 | |
| 		return string(m.Checkpoint), len(m.Checkpoint) > 0
 | |
| 	}
 | |
| 	return "", false
 | |
| }
 | 
