github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/process.go (about)

     1  // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler)
     2  //   Input file: avdl/keybase1/process.avdl
     3  
     4  package keybase1
     5  
     6  import (
     7  	"fmt"
     8  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     9  )
    10  
    11  type FileType int
    12  
    13  const (
    14  	FileType_UNKNOWN   FileType = 0
    15  	FileType_DIRECTORY FileType = 1
    16  	FileType_FILE      FileType = 2
    17  )
    18  
    19  func (o FileType) DeepCopy() FileType { return o }
    20  
    21  var FileTypeMap = map[string]FileType{
    22  	"UNKNOWN":   0,
    23  	"DIRECTORY": 1,
    24  	"FILE":      2,
    25  }
    26  
    27  var FileTypeRevMap = map[FileType]string{
    28  	0: "UNKNOWN",
    29  	1: "DIRECTORY",
    30  	2: "FILE",
    31  }
    32  
    33  func (e FileType) String() string {
    34  	if v, ok := FileTypeRevMap[e]; ok {
    35  		return v
    36  	}
    37  	return fmt.Sprintf("%v", int(e))
    38  }
    39  
    40  type FileDescriptor struct {
    41  	Name string   `codec:"name" json:"name"`
    42  	Type FileType `codec:"type" json:"type"`
    43  }
    44  
    45  func (o FileDescriptor) DeepCopy() FileDescriptor {
    46  	return FileDescriptor{
    47  		Name: o.Name,
    48  		Type: o.Type.DeepCopy(),
    49  	}
    50  }
    51  
    52  type Process struct {
    53  	Pid             string           `codec:"pid" json:"pid"`
    54  	Command         string           `codec:"command" json:"command"`
    55  	FileDescriptors []FileDescriptor `codec:"fileDescriptors" json:"fileDescriptors"`
    56  }
    57  
    58  func (o Process) DeepCopy() Process {
    59  	return Process{
    60  		Pid:     o.Pid,
    61  		Command: o.Command,
    62  		FileDescriptors: (func(x []FileDescriptor) []FileDescriptor {
    63  			if x == nil {
    64  				return nil
    65  			}
    66  			ret := make([]FileDescriptor, len(x))
    67  			for i, v := range x {
    68  				vCopy := v.DeepCopy()
    69  				ret[i] = vCopy
    70  			}
    71  			return ret
    72  		})(o.FileDescriptors),
    73  	}
    74  }
    75  
    76  type ProcessInterface interface {
    77  }
    78  
    79  func ProcessProtocol(i ProcessInterface) rpc.Protocol {
    80  	return rpc.Protocol{
    81  		Name:    "keybase.1.process",
    82  		Methods: map[string]rpc.ServeHandlerDescription{},
    83  	}
    84  }
    85  
    86  type ProcessClient struct {
    87  	Cli rpc.GenericClient
    88  }