github.com/oam-dev/kubevela@v1.9.11/design/api/vela-plugin-registry-reference.md (about) 1 # KubeVela Plugin Registry Reference 2 3 ## registry interface intro 4 5 `Registry` interface definitions have two methods: `GetCap` and `ListCaps`. Here "Cap" can represent trait or component definition 6 7 ```go 8 // Registry define a registry stores trait & component defs 9 type Registry interface { 10 GetCap(addonName string) (types.Capability, []byte, error) 11 ListCaps() ([]types.Capability, error) 12 } 13 ``` 14 15 Now we have implemented:`GithubRegistry`, `LocalRegistry` and `OssRegistry`, which represent three types of registry source. 16 17 To create a `Registry` object you should and must call `NewRegistry()`. 18 19 ### Helper type or function 20 21 You could use `RegistryFile` to convert `[]byte` (easily got from all kinds of source) to `Capability`. Here is `RegistryFile`'s definition. 22 23 ```go 24 // RegistryFile describes a file item in registry 25 type RegistryFile struct { 26 data []byte // file content 27 name string // file's name 28 } 29 ``` 30 31 ## Registry vs Capcenter 32 33 How they differ from each other? `Capcenter` is a type for vela CLI. It has some function to sync content from remote and local `~/.vela` directory and apply some `ComponentDefinition` or `TraitDefinition` to the cluster. In the contrast, `Registry` is a type for kubectl vela plugin, which focuses on cluster directly. In one word, `Registry` has no local operations. They share some basic function.