Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplyPatchHeader = Header{
Name: "content-type",
Value: "application/apply-patch+yaml",
}
View Source
var MergePatchHeader = Header{
Name: "content-type",
Value: "application/merge-patch+json",
}
Functions ¶
func NewObjectAPI ¶
func NewObjectAPI[T interface{}](kc Interface, gvr types.GroupVersionResource, opt ...ObjectAPIOption) types.ObjectAPI[T]
Types ¶
type DefaultClient ¶
func NewInCluster ¶
func NewInCluster() (*DefaultClient, error)
NewInCluster creates Client if it is inside Kubernetes.
func (*DefaultClient) APIServerURL ¶
func (kc *DefaultClient) APIServerURL() string
func (*DefaultClient) Token ¶
func (kc *DefaultClient) Token() string
type DefaultLogger ¶
type DefaultLogger struct { }
func (*DefaultLogger) Infof ¶
func (l *DefaultLogger) Infof(format string, args ...any)
type Interface ¶
type Interface interface { // Do sends HTTP request to ObjectAPI server. Do(req *http.Request) (*http.Response, error) // Token returns current access token. Token() string // APIServerURL returns API server URL. APIServerURL() string }
Interface is minimal kubernetes Client interface.
type ObjectAPIOption ¶
type ObjectAPIOption func(opts *objectAPIOptions)
func WithLogger ¶
func WithLogger(log Logger) ObjectAPIOption
func WithResponseDecoder ¶
func WithResponseDecoder(decoderFunc ResponseDecoderFunc) ObjectAPIOption
type ResourceRequest ¶
type ResponseDecoder ¶
ResponseDecoder allows to specify custom JSON response decoder. By default, std json decoder is used.
type ResponseDecoderFunc ¶
type ResponseDecoderFunc func(r io.Reader) ResponseDecoder
Click to show internal directories.
Click to hide internal directories.