Documentation ¶
Index ¶
- Constants
- Variables
- func APIServerLocationByCluster(ctx context.Context, clusterName string, ...) (*url.URL, http.RoundTripper, string, error)
- func BuildTransportV1(credential *platformv1.ClusterCredential) (http.RoundTripper, error)
- func FilterLogAgent(ctx context.Context, decorator *logagent.LogAgent) error
- func GetClusterClient(ctx context.Context, clusterName string, ...) (kubernetes.Interface, error)
- func GetClusterPodIP(ctx context.Context, clusterName, namespace, podName string, ...) (string, error)
- func GetRegistryDomain() string
- func GetRegistryNamespace() string
- func Init(domain string, namespace string)
- func WriteResponseError(rw http.ResponseWriter, code ErrorCode, message string)
- type ErrorCode
- type LocationStreamer
- type ReaderCloserGetter
- type ResponseError
Constants ¶
View Source
const (
LogagentPort = "8090"
)
Variables ¶
View Source
var ClusterNameToClient sync.Map
ClusterNameToClient mapping cluster to kubernetes client clusterName => kubernetes.Interface
Functions ¶
func APIServerLocationByCluster ¶
func APIServerLocationByCluster(ctx context.Context, clusterName string, platformClient platformversionedclient.PlatformV1Interface) (*url.URL, http.RoundTripper, string, error)
TODO: use api && controller instead of proxy
func BuildTransportV1 ¶
func BuildTransportV1(credential *platformv1.ClusterCredential) (http.RoundTripper, error)
BuildTransport create the http transport for communicate to backend kubernetes api server.
func FilterLogAgent ¶
FilterLogAgent is used to filter log collector that do not belong to the tenant.
func GetClusterClient ¶
func GetClusterClient(ctx context.Context, clusterName string, platformClient platformversionedclient.PlatformV1Interface) (kubernetes.Interface, error)
GetClusterClient get kubernetes client via cluster name
func GetClusterPodIP ¶
func GetClusterPodIP(ctx context.Context, clusterName, namespace, podName string, platformClient platformversionedclient.PlatformV1Interface) (string, error)
use cache to optimize this function
func GetRegistryDomain ¶
func GetRegistryDomain() string
func GetRegistryNamespace ¶
func GetRegistryNamespace() string
func WriteResponseError ¶
func WriteResponseError(rw http.ResponseWriter, code ErrorCode, message string)
Types ¶
type LocationStreamer ¶
type LocationStreamer struct { IP string Request ReaderCloserGetter Location *url.URL Transport http.RoundTripper ContentType string Flush bool ResponseChecker genericrest.HttpResponseChecker RedirectChecker func(req *http.Request, via []*http.Request) error }
LocationStreamer is a resource that streams the contents of a particular location URL.
func (*LocationStreamer) DeepCopyObject ¶
func (s *LocationStreamer) DeepCopyObject() runtime.Object
func (*LocationStreamer) GetObjectKind ¶
func (s *LocationStreamer) GetObjectKind() schema.ObjectKind
func (*LocationStreamer) InputStream ¶
func (s *LocationStreamer) InputStream(ctx context.Context, apiVersion, acceptHeader string) (stream io.ReadCloser, flush bool, contentType string, err error)
InputStream returns a stream with the contents of the URL location. If no location is provided, a null stream is returned.
type ReaderCloserGetter ¶
type ReaderCloserGetter interface {
GetReaderCloser() (io.ReadCloser, error)
}
type ResponseError ¶
Click to show internal directories.
Click to hide internal directories.