github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/identify_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/identify_common.avdl
     3  
     4  package keybase1
     5  
     6  import (
     7  	"fmt"
     8  	"github.com/keybase/go-framed-msgpack-rpc/rpc"
     9  )
    10  
    11  type TrackToken string
    12  
    13  func (o TrackToken) DeepCopy() TrackToken {
    14  	return o
    15  }
    16  
    17  type SigVersion int
    18  
    19  func (o SigVersion) DeepCopy() SigVersion {
    20  	return o
    21  }
    22  
    23  type TrackDiffType int
    24  
    25  const (
    26  	TrackDiffType_NONE               TrackDiffType = 0
    27  	TrackDiffType_ERROR              TrackDiffType = 1
    28  	TrackDiffType_CLASH              TrackDiffType = 2
    29  	TrackDiffType_REVOKED            TrackDiffType = 3
    30  	TrackDiffType_UPGRADED           TrackDiffType = 4
    31  	TrackDiffType_NEW                TrackDiffType = 5
    32  	TrackDiffType_REMOTE_FAIL        TrackDiffType = 6
    33  	TrackDiffType_REMOTE_WORKING     TrackDiffType = 7
    34  	TrackDiffType_REMOTE_CHANGED     TrackDiffType = 8
    35  	TrackDiffType_NEW_ELDEST         TrackDiffType = 9
    36  	TrackDiffType_NONE_VIA_TEMPORARY TrackDiffType = 10
    37  )
    38  
    39  func (o TrackDiffType) DeepCopy() TrackDiffType { return o }
    40  
    41  var TrackDiffTypeMap = map[string]TrackDiffType{
    42  	"NONE":               0,
    43  	"ERROR":              1,
    44  	"CLASH":              2,
    45  	"REVOKED":            3,
    46  	"UPGRADED":           4,
    47  	"NEW":                5,
    48  	"REMOTE_FAIL":        6,
    49  	"REMOTE_WORKING":     7,
    50  	"REMOTE_CHANGED":     8,
    51  	"NEW_ELDEST":         9,
    52  	"NONE_VIA_TEMPORARY": 10,
    53  }
    54  
    55  var TrackDiffTypeRevMap = map[TrackDiffType]string{
    56  	0:  "NONE",
    57  	1:  "ERROR",
    58  	2:  "CLASH",
    59  	3:  "REVOKED",
    60  	4:  "UPGRADED",
    61  	5:  "NEW",
    62  	6:  "REMOTE_FAIL",
    63  	7:  "REMOTE_WORKING",
    64  	8:  "REMOTE_CHANGED",
    65  	9:  "NEW_ELDEST",
    66  	10: "NONE_VIA_TEMPORARY",
    67  }
    68  
    69  func (e TrackDiffType) String() string {
    70  	if v, ok := TrackDiffTypeRevMap[e]; ok {
    71  		return v
    72  	}
    73  	return fmt.Sprintf("%v", int(e))
    74  }
    75  
    76  type TrackDiff struct {
    77  	Type          TrackDiffType `codec:"type" json:"type"`
    78  	DisplayMarkup string        `codec:"displayMarkup" json:"displayMarkup"`
    79  }
    80  
    81  func (o TrackDiff) DeepCopy() TrackDiff {
    82  	return TrackDiff{
    83  		Type:          o.Type.DeepCopy(),
    84  		DisplayMarkup: o.DisplayMarkup,
    85  	}
    86  }
    87  
    88  type TrackSummary struct {
    89  	Username string `codec:"username" json:"username"`
    90  	Time     Time   `codec:"time" json:"time"`
    91  	IsRemote bool   `codec:"isRemote" json:"isRemote"`
    92  }
    93  
    94  func (o TrackSummary) DeepCopy() TrackSummary {
    95  	return TrackSummary{
    96  		Username: o.Username,
    97  		Time:     o.Time.DeepCopy(),
    98  		IsRemote: o.IsRemote,
    99  	}
   100  }
   101  
   102  // TrackStatus is a summary of this track before the track is approved by the
   103  // user.
   104  // NEW_*: New tracks
   105  // UPDATE_*: Update to an existing track
   106  // NEW_OK: Everything ok
   107  // NEW_ZERO_PROOFS: User being tracked has no proofs
   108  // NEW_FAIL_PROOFS: User being tracked has some failed proofs
   109  // UPDATE_BROKEN: Previous tracking statement broken, this one will fix it.
   110  // UPDATE_NEW_PROOFS: Previous tracking statement ok, but there are new proofs since previous tracking statement generated
   111  // UPDATE_OK: No changes to previous tracking statement
   112  type TrackStatus int
   113  
   114  const (
   115  	TrackStatus_NEW_OK                      TrackStatus = 1
   116  	TrackStatus_NEW_ZERO_PROOFS             TrackStatus = 2
   117  	TrackStatus_NEW_FAIL_PROOFS             TrackStatus = 3
   118  	TrackStatus_UPDATE_BROKEN_FAILED_PROOFS TrackStatus = 4
   119  	TrackStatus_UPDATE_NEW_PROOFS           TrackStatus = 5
   120  	TrackStatus_UPDATE_OK                   TrackStatus = 6
   121  	TrackStatus_UPDATE_BROKEN_REVOKED       TrackStatus = 7
   122  )
   123  
   124  func (o TrackStatus) DeepCopy() TrackStatus { return o }
   125  
   126  var TrackStatusMap = map[string]TrackStatus{
   127  	"NEW_OK":                      1,
   128  	"NEW_ZERO_PROOFS":             2,
   129  	"NEW_FAIL_PROOFS":             3,
   130  	"UPDATE_BROKEN_FAILED_PROOFS": 4,
   131  	"UPDATE_NEW_PROOFS":           5,
   132  	"UPDATE_OK":                   6,
   133  	"UPDATE_BROKEN_REVOKED":       7,
   134  }
   135  
   136  var TrackStatusRevMap = map[TrackStatus]string{
   137  	1: "NEW_OK",
   138  	2: "NEW_ZERO_PROOFS",
   139  	3: "NEW_FAIL_PROOFS",
   140  	4: "UPDATE_BROKEN_FAILED_PROOFS",
   141  	5: "UPDATE_NEW_PROOFS",
   142  	6: "UPDATE_OK",
   143  	7: "UPDATE_BROKEN_REVOKED",
   144  }
   145  
   146  func (e TrackStatus) String() string {
   147  	if v, ok := TrackStatusRevMap[e]; ok {
   148  		return v
   149  	}
   150  	return fmt.Sprintf("%v", int(e))
   151  }
   152  
   153  type TrackOptions struct {
   154  	LocalOnly     bool        `codec:"localOnly" json:"localOnly"`
   155  	BypassConfirm bool        `codec:"bypassConfirm" json:"bypassConfirm"`
   156  	ForceRetrack  bool        `codec:"forceRetrack" json:"forceRetrack"`
   157  	ExpiringLocal bool        `codec:"expiringLocal" json:"expiringLocal"`
   158  	ForPGPPull    bool        `codec:"forPGPPull" json:"forPGPPull"`
   159  	SigVersion    *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"`
   160  }
   161  
   162  func (o TrackOptions) DeepCopy() TrackOptions {
   163  	return TrackOptions{
   164  		LocalOnly:     o.LocalOnly,
   165  		BypassConfirm: o.BypassConfirm,
   166  		ForceRetrack:  o.ForceRetrack,
   167  		ExpiringLocal: o.ExpiringLocal,
   168  		ForPGPPull:    o.ForPGPPull,
   169  		SigVersion: (func(x *SigVersion) *SigVersion {
   170  			if x == nil {
   171  				return nil
   172  			}
   173  			tmp := (*x).DeepCopy()
   174  			return &tmp
   175  		})(o.SigVersion),
   176  	}
   177  }
   178  
   179  type IdentifyReasonType int
   180  
   181  const (
   182  	IdentifyReasonType_NONE       IdentifyReasonType = 0
   183  	IdentifyReasonType_ID         IdentifyReasonType = 1
   184  	IdentifyReasonType_TRACK      IdentifyReasonType = 2
   185  	IdentifyReasonType_ENCRYPT    IdentifyReasonType = 3
   186  	IdentifyReasonType_DECRYPT    IdentifyReasonType = 4
   187  	IdentifyReasonType_VERIFY     IdentifyReasonType = 5
   188  	IdentifyReasonType_RESOURCE   IdentifyReasonType = 6
   189  	IdentifyReasonType_BACKGROUND IdentifyReasonType = 7
   190  )
   191  
   192  func (o IdentifyReasonType) DeepCopy() IdentifyReasonType { return o }
   193  
   194  var IdentifyReasonTypeMap = map[string]IdentifyReasonType{
   195  	"NONE":       0,
   196  	"ID":         1,
   197  	"TRACK":      2,
   198  	"ENCRYPT":    3,
   199  	"DECRYPT":    4,
   200  	"VERIFY":     5,
   201  	"RESOURCE":   6,
   202  	"BACKGROUND": 7,
   203  }
   204  
   205  var IdentifyReasonTypeRevMap = map[IdentifyReasonType]string{
   206  	0: "NONE",
   207  	1: "ID",
   208  	2: "TRACK",
   209  	3: "ENCRYPT",
   210  	4: "DECRYPT",
   211  	5: "VERIFY",
   212  	6: "RESOURCE",
   213  	7: "BACKGROUND",
   214  }
   215  
   216  func (e IdentifyReasonType) String() string {
   217  	if v, ok := IdentifyReasonTypeRevMap[e]; ok {
   218  		return v
   219  	}
   220  	return fmt.Sprintf("%v", int(e))
   221  }
   222  
   223  type IdentifyReason struct {
   224  	Type     IdentifyReasonType `codec:"type" json:"type"`
   225  	Reason   string             `codec:"reason" json:"reason"`
   226  	Resource string             `codec:"resource" json:"resource"`
   227  }
   228  
   229  func (o IdentifyReason) DeepCopy() IdentifyReason {
   230  	return IdentifyReason{
   231  		Type:     o.Type.DeepCopy(),
   232  		Reason:   o.Reason,
   233  		Resource: o.Resource,
   234  	}
   235  }
   236  
   237  type IdentifyOutcome struct {
   238  	Username          string         `codec:"username" json:"username"`
   239  	Status            *Status        `codec:"status,omitempty" json:"status,omitempty"`
   240  	Warnings          []string       `codec:"warnings" json:"warnings"`
   241  	TrackUsed         *TrackSummary  `codec:"trackUsed,omitempty" json:"trackUsed,omitempty"`
   242  	TrackStatus       TrackStatus    `codec:"trackStatus" json:"trackStatus"`
   243  	NumTrackFailures  int            `codec:"numTrackFailures" json:"numTrackFailures"`
   244  	NumTrackChanges   int            `codec:"numTrackChanges" json:"numTrackChanges"`
   245  	NumProofFailures  int            `codec:"numProofFailures" json:"numProofFailures"`
   246  	NumRevoked        int            `codec:"numRevoked" json:"numRevoked"`
   247  	NumProofSuccesses int            `codec:"numProofSuccesses" json:"numProofSuccesses"`
   248  	Revoked           []TrackDiff    `codec:"revoked" json:"revoked"`
   249  	TrackOptions      TrackOptions   `codec:"trackOptions" json:"trackOptions"`
   250  	ForPGPPull        bool           `codec:"forPGPPull" json:"forPGPPull"`
   251  	Reason            IdentifyReason `codec:"reason" json:"reason"`
   252  }
   253  
   254  func (o IdentifyOutcome) DeepCopy() IdentifyOutcome {
   255  	return IdentifyOutcome{
   256  		Username: o.Username,
   257  		Status: (func(x *Status) *Status {
   258  			if x == nil {
   259  				return nil
   260  			}
   261  			tmp := (*x).DeepCopy()
   262  			return &tmp
   263  		})(o.Status),
   264  		Warnings: (func(x []string) []string {
   265  			if x == nil {
   266  				return nil
   267  			}
   268  			ret := make([]string, len(x))
   269  			for i, v := range x {
   270  				vCopy := v
   271  				ret[i] = vCopy
   272  			}
   273  			return ret
   274  		})(o.Warnings),
   275  		TrackUsed: (func(x *TrackSummary) *TrackSummary {
   276  			if x == nil {
   277  				return nil
   278  			}
   279  			tmp := (*x).DeepCopy()
   280  			return &tmp
   281  		})(o.TrackUsed),
   282  		TrackStatus:       o.TrackStatus.DeepCopy(),
   283  		NumTrackFailures:  o.NumTrackFailures,
   284  		NumTrackChanges:   o.NumTrackChanges,
   285  		NumProofFailures:  o.NumProofFailures,
   286  		NumRevoked:        o.NumRevoked,
   287  		NumProofSuccesses: o.NumProofSuccesses,
   288  		Revoked: (func(x []TrackDiff) []TrackDiff {
   289  			if x == nil {
   290  				return nil
   291  			}
   292  			ret := make([]TrackDiff, len(x))
   293  			for i, v := range x {
   294  				vCopy := v.DeepCopy()
   295  				ret[i] = vCopy
   296  			}
   297  			return ret
   298  		})(o.Revoked),
   299  		TrackOptions: o.TrackOptions.DeepCopy(),
   300  		ForPGPPull:   o.ForPGPPull,
   301  		Reason:       o.Reason.DeepCopy(),
   302  	}
   303  }
   304  
   305  type RemoteProof struct {
   306  	ProofType     ProofType `codec:"proofType" json:"proofType"`
   307  	Key           string    `codec:"key" json:"key"`
   308  	Value         string    `codec:"value" json:"value"`
   309  	DisplayMarkup string    `codec:"displayMarkup" json:"displayMarkup"`
   310  	SigID         SigID     `codec:"sigID" json:"sigID"`
   311  	MTime         Time      `codec:"mTime" json:"mTime"`
   312  }
   313  
   314  func (o RemoteProof) DeepCopy() RemoteProof {
   315  	return RemoteProof{
   316  		ProofType:     o.ProofType.DeepCopy(),
   317  		Key:           o.Key,
   318  		Value:         o.Value,
   319  		DisplayMarkup: o.DisplayMarkup,
   320  		SigID:         o.SigID.DeepCopy(),
   321  		MTime:         o.MTime.DeepCopy(),
   322  	}
   323  }
   324  
   325  type IdentifyCommonInterface interface {
   326  }
   327  
   328  func IdentifyCommonProtocol(i IdentifyCommonInterface) rpc.Protocol {
   329  	return rpc.Protocol{
   330  		Name:    "keybase.1.identifyCommon",
   331  		Methods: map[string]rpc.ServeHandlerDescription{},
   332  	}
   333  }
   334  
   335  type IdentifyCommonClient struct {
   336  	Cli rpc.GenericClient
   337  }