github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/kbfs_common.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/kbfs_common.avdl
     3  
     4  package keybase1
     5  
     6  import (
     7  	"fmt"
     8  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     9  )
    10  
    11  type FSStatusCode int
    12  
    13  const (
    14  	FSStatusCode_START  FSStatusCode = 0
    15  	FSStatusCode_FINISH FSStatusCode = 1
    16  	FSStatusCode_ERROR  FSStatusCode = 2
    17  )
    18  
    19  func (o FSStatusCode) DeepCopy() FSStatusCode { return o }
    20  
    21  var FSStatusCodeMap = map[string]FSStatusCode{
    22  	"START":  0,
    23  	"FINISH": 1,
    24  	"ERROR":  2,
    25  }
    26  
    27  var FSStatusCodeRevMap = map[FSStatusCode]string{
    28  	0: "START",
    29  	1: "FINISH",
    30  	2: "ERROR",
    31  }
    32  
    33  func (e FSStatusCode) String() string {
    34  	if v, ok := FSStatusCodeRevMap[e]; ok {
    35  		return v
    36  	}
    37  	return fmt.Sprintf("%v", int(e))
    38  }
    39  
    40  type FSNotificationType int
    41  
    42  const (
    43  	FSNotificationType_ENCRYPTING          FSNotificationType = 0
    44  	FSNotificationType_DECRYPTING          FSNotificationType = 1
    45  	FSNotificationType_SIGNING             FSNotificationType = 2
    46  	FSNotificationType_VERIFYING           FSNotificationType = 3
    47  	FSNotificationType_REKEYING            FSNotificationType = 4
    48  	FSNotificationType_CONNECTION          FSNotificationType = 5
    49  	FSNotificationType_MD_READ_SUCCESS     FSNotificationType = 6
    50  	FSNotificationType_FILE_CREATED        FSNotificationType = 7
    51  	FSNotificationType_FILE_MODIFIED       FSNotificationType = 8
    52  	FSNotificationType_FILE_DELETED        FSNotificationType = 9
    53  	FSNotificationType_FILE_RENAMED        FSNotificationType = 10
    54  	FSNotificationType_INITIALIZED         FSNotificationType = 11
    55  	FSNotificationType_SYNC_CONFIG_CHANGED FSNotificationType = 12
    56  )
    57  
    58  func (o FSNotificationType) DeepCopy() FSNotificationType { return o }
    59  
    60  var FSNotificationTypeMap = map[string]FSNotificationType{
    61  	"ENCRYPTING":          0,
    62  	"DECRYPTING":          1,
    63  	"SIGNING":             2,
    64  	"VERIFYING":           3,
    65  	"REKEYING":            4,
    66  	"CONNECTION":          5,
    67  	"MD_READ_SUCCESS":     6,
    68  	"FILE_CREATED":        7,
    69  	"FILE_MODIFIED":       8,
    70  	"FILE_DELETED":        9,
    71  	"FILE_RENAMED":        10,
    72  	"INITIALIZED":         11,
    73  	"SYNC_CONFIG_CHANGED": 12,
    74  }
    75  
    76  var FSNotificationTypeRevMap = map[FSNotificationType]string{
    77  	0:  "ENCRYPTING",
    78  	1:  "DECRYPTING",
    79  	2:  "SIGNING",
    80  	3:  "VERIFYING",
    81  	4:  "REKEYING",
    82  	5:  "CONNECTION",
    83  	6:  "MD_READ_SUCCESS",
    84  	7:  "FILE_CREATED",
    85  	8:  "FILE_MODIFIED",
    86  	9:  "FILE_DELETED",
    87  	10: "FILE_RENAMED",
    88  	11: "INITIALIZED",
    89  	12: "SYNC_CONFIG_CHANGED",
    90  }
    91  
    92  func (e FSNotificationType) String() string {
    93  	if v, ok := FSNotificationTypeRevMap[e]; ok {
    94  		return v
    95  	}
    96  	return fmt.Sprintf("%v", int(e))
    97  }
    98  
    99  type FSErrorType int
   100  
   101  const (
   102  	FSErrorType_ACCESS_DENIED             FSErrorType = 0
   103  	FSErrorType_USER_NOT_FOUND            FSErrorType = 1
   104  	FSErrorType_REVOKED_DATA_DETECTED     FSErrorType = 2
   105  	FSErrorType_NOT_LOGGED_IN             FSErrorType = 3
   106  	FSErrorType_TIMEOUT                   FSErrorType = 4
   107  	FSErrorType_REKEY_NEEDED              FSErrorType = 5
   108  	FSErrorType_BAD_FOLDER                FSErrorType = 6
   109  	FSErrorType_NOT_IMPLEMENTED           FSErrorType = 7
   110  	FSErrorType_OLD_VERSION               FSErrorType = 8
   111  	FSErrorType_OVER_QUOTA                FSErrorType = 9
   112  	FSErrorType_NO_SIG_CHAIN              FSErrorType = 10
   113  	FSErrorType_TOO_MANY_FOLDERS          FSErrorType = 11
   114  	FSErrorType_EXDEV_NOT_SUPPORTED       FSErrorType = 12
   115  	FSErrorType_DISK_LIMIT_REACHED        FSErrorType = 13
   116  	FSErrorType_DISK_CACHE_ERROR_LOG_SEND FSErrorType = 14
   117  	FSErrorType_OFFLINE_ARCHIVED          FSErrorType = 15
   118  	FSErrorType_OFFLINE_UNSYNCED          FSErrorType = 16
   119  )
   120  
   121  func (o FSErrorType) DeepCopy() FSErrorType { return o }
   122  
   123  var FSErrorTypeMap = map[string]FSErrorType{
   124  	"ACCESS_DENIED":             0,
   125  	"USER_NOT_FOUND":            1,
   126  	"REVOKED_DATA_DETECTED":     2,
   127  	"NOT_LOGGED_IN":             3,
   128  	"TIMEOUT":                   4,
   129  	"REKEY_NEEDED":              5,
   130  	"BAD_FOLDER":                6,
   131  	"NOT_IMPLEMENTED":           7,
   132  	"OLD_VERSION":               8,
   133  	"OVER_QUOTA":                9,
   134  	"NO_SIG_CHAIN":              10,
   135  	"TOO_MANY_FOLDERS":          11,
   136  	"EXDEV_NOT_SUPPORTED":       12,
   137  	"DISK_LIMIT_REACHED":        13,
   138  	"DISK_CACHE_ERROR_LOG_SEND": 14,
   139  	"OFFLINE_ARCHIVED":          15,
   140  	"OFFLINE_UNSYNCED":          16,
   141  }
   142  
   143  var FSErrorTypeRevMap = map[FSErrorType]string{
   144  	0:  "ACCESS_DENIED",
   145  	1:  "USER_NOT_FOUND",
   146  	2:  "REVOKED_DATA_DETECTED",
   147  	3:  "NOT_LOGGED_IN",
   148  	4:  "TIMEOUT",
   149  	5:  "REKEY_NEEDED",
   150  	6:  "BAD_FOLDER",
   151  	7:  "NOT_IMPLEMENTED",
   152  	8:  "OLD_VERSION",
   153  	9:  "OVER_QUOTA",
   154  	10: "NO_SIG_CHAIN",
   155  	11: "TOO_MANY_FOLDERS",
   156  	12: "EXDEV_NOT_SUPPORTED",
   157  	13: "DISK_LIMIT_REACHED",
   158  	14: "DISK_CACHE_ERROR_LOG_SEND",
   159  	15: "OFFLINE_ARCHIVED",
   160  	16: "OFFLINE_UNSYNCED",
   161  }
   162  
   163  func (e FSErrorType) String() string {
   164  	if v, ok := FSErrorTypeRevMap[e]; ok {
   165  		return v
   166  	}
   167  	return fmt.Sprintf("%v", int(e))
   168  }
   169  
   170  type FSNotification struct {
   171  	Filename         string             `codec:"filename" json:"filename"`
   172  	Status           string             `codec:"status" json:"status"`
   173  	StatusCode       FSStatusCode       `codec:"statusCode" json:"statusCode"`
   174  	NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
   175  	ErrorType        FSErrorType        `codec:"errorType" json:"errorType"`
   176  	Params           map[string]string  `codec:"params" json:"params"`
   177  	WriterUid        UID                `codec:"writerUid" json:"writerUid"`
   178  	LocalTime        Time               `codec:"localTime" json:"localTime"`
   179  	FolderType       FolderType         `codec:"folderType" json:"folderType"`
   180  }
   181  
   182  func (o FSNotification) DeepCopy() FSNotification {
   183  	return FSNotification{
   184  		Filename:         o.Filename,
   185  		Status:           o.Status,
   186  		StatusCode:       o.StatusCode.DeepCopy(),
   187  		NotificationType: o.NotificationType.DeepCopy(),
   188  		ErrorType:        o.ErrorType.DeepCopy(),
   189  		Params: (func(x map[string]string) map[string]string {
   190  			if x == nil {
   191  				return nil
   192  			}
   193  			ret := make(map[string]string, len(x))
   194  			for k, v := range x {
   195  				kCopy := k
   196  				vCopy := v
   197  				ret[kCopy] = vCopy
   198  			}
   199  			return ret
   200  		})(o.Params),
   201  		WriterUid:  o.WriterUid.DeepCopy(),
   202  		LocalTime:  o.LocalTime.DeepCopy(),
   203  		FolderType: o.FolderType.DeepCopy(),
   204  	}
   205  }
   206  
   207  type FSEditListRequest struct {
   208  	Folder    Folder `codec:"folder" json:"folder"`
   209  	RequestID int    `codec:"requestID" json:"requestID"`
   210  }
   211  
   212  func (o FSEditListRequest) DeepCopy() FSEditListRequest {
   213  	return FSEditListRequest{
   214  		Folder:    o.Folder.DeepCopy(),
   215  		RequestID: o.RequestID,
   216  	}
   217  }
   218  
   219  type FSFolderWriterEdit struct {
   220  	Filename         string             `codec:"filename" json:"filename"`
   221  	NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
   222  	ServerTime       Time               `codec:"serverTime" json:"serverTime"`
   223  }
   224  
   225  func (o FSFolderWriterEdit) DeepCopy() FSFolderWriterEdit {
   226  	return FSFolderWriterEdit{
   227  		Filename:         o.Filename,
   228  		NotificationType: o.NotificationType.DeepCopy(),
   229  		ServerTime:       o.ServerTime.DeepCopy(),
   230  	}
   231  }
   232  
   233  type FSFolderWriterEditHistory struct {
   234  	WriterName string               `codec:"writerName" json:"writerName"`
   235  	Edits      []FSFolderWriterEdit `codec:"edits" json:"edits"`
   236  	Deletes    []FSFolderWriterEdit `codec:"deletes" json:"deletes"`
   237  }
   238  
   239  func (o FSFolderWriterEditHistory) DeepCopy() FSFolderWriterEditHistory {
   240  	return FSFolderWriterEditHistory{
   241  		WriterName: o.WriterName,
   242  		Edits: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit {
   243  			if x == nil {
   244  				return nil
   245  			}
   246  			ret := make([]FSFolderWriterEdit, len(x))
   247  			for i, v := range x {
   248  				vCopy := v.DeepCopy()
   249  				ret[i] = vCopy
   250  			}
   251  			return ret
   252  		})(o.Edits),
   253  		Deletes: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit {
   254  			if x == nil {
   255  				return nil
   256  			}
   257  			ret := make([]FSFolderWriterEdit, len(x))
   258  			for i, v := range x {
   259  				vCopy := v.DeepCopy()
   260  				ret[i] = vCopy
   261  			}
   262  			return ret
   263  		})(o.Deletes),
   264  	}
   265  }
   266  
   267  type FSFolderEditHistory struct {
   268  	Folder     Folder                      `codec:"folder" json:"folder"`
   269  	ServerTime Time                        `codec:"serverTime" json:"serverTime"`
   270  	History    []FSFolderWriterEditHistory `codec:"history" json:"history"`
   271  }
   272  
   273  func (o FSFolderEditHistory) DeepCopy() FSFolderEditHistory {
   274  	return FSFolderEditHistory{
   275  		Folder:     o.Folder.DeepCopy(),
   276  		ServerTime: o.ServerTime.DeepCopy(),
   277  		History: (func(x []FSFolderWriterEditHistory) []FSFolderWriterEditHistory {
   278  			if x == nil {
   279  				return nil
   280  			}
   281  			ret := make([]FSFolderWriterEditHistory, len(x))
   282  			for i, v := range x {
   283  				vCopy := v.DeepCopy()
   284  				ret[i] = vCopy
   285  			}
   286  			return ret
   287  		})(o.History),
   288  	}
   289  }
   290  
   291  type FSSyncStatusRequest struct {
   292  	RequestID int `codec:"requestID" json:"requestID"`
   293  }
   294  
   295  func (o FSSyncStatusRequest) DeepCopy() FSSyncStatusRequest {
   296  	return FSSyncStatusRequest{
   297  		RequestID: o.RequestID,
   298  	}
   299  }
   300  
   301  type FSPathSyncStatus struct {
   302  	FolderType   FolderType `codec:"folderType" json:"folderType"`
   303  	Path         string     `codec:"path" json:"path"`
   304  	SyncingBytes int64      `codec:"syncingBytes" json:"syncingBytes"`
   305  	SyncingOps   int64      `codec:"syncingOps" json:"syncingOps"`
   306  	SyncedBytes  int64      `codec:"syncedBytes" json:"syncedBytes"`
   307  }
   308  
   309  func (o FSPathSyncStatus) DeepCopy() FSPathSyncStatus {
   310  	return FSPathSyncStatus{
   311  		FolderType:   o.FolderType.DeepCopy(),
   312  		Path:         o.Path,
   313  		SyncingBytes: o.SyncingBytes,
   314  		SyncingOps:   o.SyncingOps,
   315  		SyncedBytes:  o.SyncedBytes,
   316  	}
   317  }
   318  
   319  type FSSyncStatus struct {
   320  	TotalSyncingBytes int64    `codec:"totalSyncingBytes" json:"totalSyncingBytes"`
   321  	SyncingPaths      []string `codec:"syncingPaths" json:"syncingPaths"`
   322  	EndEstimate       *Time    `codec:"endEstimate,omitempty" json:"endEstimate,omitempty"`
   323  }
   324  
   325  func (o FSSyncStatus) DeepCopy() FSSyncStatus {
   326  	return FSSyncStatus{
   327  		TotalSyncingBytes: o.TotalSyncingBytes,
   328  		SyncingPaths: (func(x []string) []string {
   329  			if x == nil {
   330  				return nil
   331  			}
   332  			ret := make([]string, len(x))
   333  			for i, v := range x {
   334  				vCopy := v
   335  				ret[i] = vCopy
   336  			}
   337  			return ret
   338  		})(o.SyncingPaths),
   339  		EndEstimate: (func(x *Time) *Time {
   340  			if x == nil {
   341  				return nil
   342  			}
   343  			tmp := (*x).DeepCopy()
   344  			return &tmp
   345  		})(o.EndEstimate),
   346  	}
   347  }
   348  
   349  type FolderSyncStatus struct {
   350  	LocalDiskBytesAvailable int64            `codec:"localDiskBytesAvailable" json:"localDiskBytesAvailable"`
   351  	LocalDiskBytesTotal     int64            `codec:"localDiskBytesTotal" json:"localDiskBytesTotal"`
   352  	PrefetchStatus          PrefetchStatus   `codec:"prefetchStatus" json:"prefetchStatus"`
   353  	PrefetchProgress        PrefetchProgress `codec:"prefetchProgress" json:"prefetchProgress"`
   354  	StoredBytesTotal        int64            `codec:"storedBytesTotal" json:"storedBytesTotal"`
   355  	OutOfSyncSpace          bool             `codec:"outOfSyncSpace" json:"outOfSyncSpace"`
   356  }
   357  
   358  func (o FolderSyncStatus) DeepCopy() FolderSyncStatus {
   359  	return FolderSyncStatus{
   360  		LocalDiskBytesAvailable: o.LocalDiskBytesAvailable,
   361  		LocalDiskBytesTotal:     o.LocalDiskBytesTotal,
   362  		PrefetchStatus:          o.PrefetchStatus.DeepCopy(),
   363  		PrefetchProgress:        o.PrefetchProgress.DeepCopy(),
   364  		StoredBytesTotal:        o.StoredBytesTotal,
   365  		OutOfSyncSpace:          o.OutOfSyncSpace,
   366  	}
   367  }
   368  
   369  type KbfsCommonInterface interface {
   370  }
   371  
   372  func KbfsCommonProtocol(i KbfsCommonInterface) rpc.Protocol {
   373  	return rpc.Protocol{
   374  		Name:    "keybase.1.kbfsCommon",
   375  		Methods: map[string]rpc.ServeHandlerDescription{},
   376  	}
   377  }
   378  
   379  type KbfsCommonClient struct {
   380  	Cli rpc.GenericClient
   381  }