1 package internal 2 3 // Operation describes action performed on endpoint (addition vs deletion). 4 // Must stay JSON-format compatible with: 5 // https://pkg.go.dev/google.golang.org/grpc@v1.29.1/naming#Operation 6 type Operation uint8 7 8 const ( 9 // Add indicates a new address is added. 10 Add Operation = iota 11 // Delete indicates an existing address is deleted. 12 Delete 13 ) 14 15 // Update defines a persistent (JSON marshalled) format representing 16 // endpoint within the etcd storage. 17 // 18 // As the format can be persisted by one version of etcd client library and 19 // read by other the format must be kept backward compatible and 20 // in particular must be superset of the grpc(<=1.29.1) naming.Update structure: 21 // https://pkg.go.dev/google.golang.org/grpc@v1.29.1/naming#Update 22 // 23 // Please document since which version of etcd-client given property is supported. 24 // Please keep the naming consistent with e.g. https://pkg.go.dev/google.golang.org/grpc/resolver#Address. 25 // 26 // Notice that it is not valid having both empty string Addr and nil Metadata in an Update. 27 type Update struct { 28 // Op indicates the operation of the update. 29 // Since etcd 3.1. 30 Op Operation 31 // Addr is the updated address. It is empty string if there is no address update. 32 // Since etcd 3.1. 33 Addr string 34 // Metadata is the updated metadata. It is nil if there is no metadata update. 35 // Metadata is not required for a custom naming implementation. 36 // Since etcd 3.1. 37 Metadata interface{} 38 } 39