{"modulePath":"github.com/UnityTech/client-go","version":"v11.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package scale\n\nPackage scale provides a polymorphic scale client capable of fetching and updating Scale for any resource which implements the \\`scale\\` subresource, as long as that subresource operates on a version of scale convertable to autoscaling.Scale.\n\n## Types\n\n```go\ntype PreferredResourceMapper interface {\n\t// ResourceFor takes a partial resource and returns the preferred resource.\n\tResourceFor(resource schema.GroupVersionResource) (preferredResource schema.GroupVersionResource, err error)\n}\n```\nPreferredResourceMapper determines the preferred version of a resource to scale\n\n```go\ntype ScaleConverter struct {\n\t// contains filtered or unexported fields\n}\n```\nScaleConverter knows how to convert between external scale versions.\n\n```go\nfunc NewScaleConverter() *ScaleConverter\n```\nNewScaleConverter creates a new ScaleConverter for converting between Scales in autoscaling/v1 and extensions/v1beta1.\n\n```go\nfunc (c *ScaleConverter) Codecs() serializer.CodecFactory\n```\n\n```go\nfunc (c *ScaleConverter) ConvertToVersion(in runtime.Object, outVersion schema.GroupVersion) (runtime.Object, error)\n```\nConvertToVersion converts the given \\*external\\* input object to the given output \\*external\\* output group-version.\n\n```go\nfunc (c *ScaleConverter) ScaleVersions() []schema.GroupVersion\n```\n\n```go\nfunc (c *ScaleConverter) Scheme() *runtime.Scheme\n```\nScheme returns the scheme used by this scale converter.\n\n```go\ntype ScaleInterface interface {\n\t// Get fetches the scale of the given scalable resource.\n\tGet(resource schema.GroupResource, name string) (*autoscalingapi.Scale, error)\n\n\t// Update updates the scale of the given scalable resource.\n\tUpdate(resource schema.GroupResource, scale *autoscalingapi.Scale) (*autoscalingapi.Scale, error)\n}\n```\nScaleInterface can fetch and update scales for resources in a particular namespace which implement the scale subresource.\n\n```go\ntype ScaleKindResolver interface {\n\t// ScaleForResource returns the GroupVersionKind of the\n\t// scale subresource for the given GroupVersionResource.\n\tScaleForResource(resource schema.GroupVersionResource) (scaleVersion schema.GroupVersionKind, err error)\n}\n```\nScaleKindResolver knows about the relationship between resources and the GroupVersionKind of their scale subresources.\n\n```go\nfunc NewDiscoveryScaleKindResolver(client discovery.ServerResourcesInterface) ScaleKindResolver\n```\nNewDiscoveryScaleKindResolver creates a new ScaleKindResolver which uses information from the given disovery client to resolve the correct Scale GroupVersionKind for different resources.\n\n```go\ntype ScalesGetter interface {\n\tScales(namespace string) ScaleInterface\n}\n```\nScalesGetter can produce a ScaleInterface for a particular namespace.\n\n```go\nfunc New(baseClient restclient.Interface, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) ScalesGetter\n```\nNew creates a new ScalesGetter using the given client to make requests. The GroupVersion on the client is ignored.\n\n```go\nfunc NewForConfig(cfg *restclient.Config, mapper PreferredResourceMapper, resolver dynamic.APIPathResolverFunc, scaleKindResolver ScaleKindResolver) (ScalesGetter, error)\n```\nNewForConfig creates a new ScalesGetter which resolves kinds to resources using the given RESTMapper, and API paths using the given dynamic.APIPathResolverFunc.\n\n","path":"github.com/UnityTech/client-go/scale","name":"scale","synopsis":"Package scale provides a polymorphic scale client capable of fetching and updating Scale for any resource which implements the `scale` subresource, as long as that subresource operates on a version of scale convertable to autoscaling.Scale.","isRedistributable":true}
