Documentation ¶
Overview ¶
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- func New() plugins.PluginInstance
- type Application
- type Applications
- type BoolString
- type Client
- func (c *Client) CommonHeaders(method string) http.Header
- func (c *Client) CreateService(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error)
- func (c *Client) DeleteService(ctx context.Context, domainProject, serviceId string) error
- func (c *Client) GetAll(ctx context.Context) (*pb.SyncData, error)
- func (c *Client) Heartbeat(ctx context.Context, domainProject, serviceId, instanceId string) error
- func (c *Client) RegisterInstance(ctx context.Context, domainProject, serviceId string, ...) (string, error)
- func (c *Client) ServiceExistence(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error)
- func (c *Client) UnregisterInstance(ctx context.Context, domainProject, serviceId, instanceId string) error
- type DataCenterInfo
- type DataCenterMetadata
- type Instance
- type InstanceRequest
- type LeaseInfo
- type MetaData
- type Port
Constants ¶
const ( UNKNOWN = "UNKNOWN" UP = "UP" DOWN = "DOWN" STARTING = "STARTING" OUTOFSERVICE = "OUTOFSERVICE" )
const (
PluginName = "eureka"
)
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() plugins.PluginInstance
Types ¶
type Application ¶
type Applications ¶
type Applications struct { VersionsDelta string `json:"versions__delta"` AppsHashcode string `json:"apps__hashcode"` Applications []*Application `json:"application,omitempty"` }
type BoolString ¶
type BoolString string
func (BoolString) Bool ¶
func (b BoolString) Bool() bool
func (*BoolString) Set ¶
func (b *BoolString) Set(value bool)
type Client ¶
func (*Client) CommonHeaders ¶
CommonHeaders Set the common header of the request
func (*Client) CreateService ¶
func (c *Client) CreateService(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error)
CreateService Eureka's application is created with instance and does not need to be processed here.
func (*Client) DeleteService ¶
DeleteService Eureka's application is created with instance and does not need to be processed here.
func (*Client) RegisterInstance ¶
func (c *Client) RegisterInstance(ctx context.Context, domainProject, serviceId string, syncInstance *pb.SyncInstance) (string, error)
RegisterInstance register instance to servicecenter
func (*Client) ServiceExistence ¶
func (c *Client) ServiceExistence(ctx context.Context, domainProject string, syncService *pb.SyncService) (string, error)
ServiceExistence Eureka's application is created with instance and does not need to be processed here.
type DataCenterInfo ¶
type DataCenterInfo struct { Name string `json:"name"` Class string `json:"@class"` Metadata *DataCenterMetadata `json:"metadata,omitempty"` }
type DataCenterMetadata ¶
type DataCenterMetadata struct { AmiLaunchIndex string `json:"ami-launch-index,omitempty"` LocalHostname string `json:"local-hostname,omitempty"` AvailabilityZone string `json:"availability-zone,omitempty"` InstanceId string `json:"instance-id,omitempty"` PublicIpv4 string `json:"public-ipv4,omitempty"` PublicHostname string `json:"public-hostname,omitempty"` AmiManifestPath string `json:"ami-manifest-path,omitempty"` LocalIpv4 string `json:"local-ipv4,omitempty"` Hostname string `json:"hostname,omitempty"` AmiId string `json:"ami-id,omitempty"` InstanceType string `json:"instance-type,omitempty"` }
type Instance ¶
type Instance struct { InstanceId string `json:"instanceId"` HostName string `json:"hostName"` APP string `json:"app"` IPAddr string `json:"ipAddr"` Status string `json:"status"` OverriddenStatus string `json:"overriddenStatus,omitempty"` Port *Port `json:"port,omitempty"` SecurePort *Port `json:"securePort,omitempty"` CountryId int `json:"countryId,omitempty"` DataCenterInfo *DataCenterInfo `json:"dataCenterInfo"` LeaseInfo *LeaseInfo `json:"leaseInfo,omitempty"` Metadata *MetaData `json:"metadata,omitempty"` HomePageUrl string `json:"homePageUrl,omitempty"` StatusPageUrl string `json:"statusPageUrl,omitempty"` HealthCheckUrl string `json:"healthCheckUrl,omitempty"` VipAddress string `json:"vipAddress,omitempty"` SecureVipAddress string `json:"secureVipAddress,omitempty"` IsCoordinatingDiscoveryServer BoolString `json:"isCoordinatingDiscoveryServer,omitempty"` LastUpdatedTimestamp string `json:"lastUpdatedTimestamp,omitempty"` LastDirtyTimestamp string `json:"lastDirtyTimestamp,omitempty"` ActionType string `json:"actionType,omitempty"` }
type InstanceRequest ¶
type InstanceRequest struct {
Instance *Instance `json:"instance"`
}
type LeaseInfo ¶
type LeaseInfo struct { RenewalIntervalInSecs int `json:"renewalIntervalInSecs,omitempty"` DurationInSecs int `json:"durationInSecs,omitempty"` RegistrationTimestamp int `json:"registrationTimestamp,omitempty"` LastRenewalTimestamp int `json:"lastRenewalTimestamp,omitempty"` EvictionDurationInSecs uint `json:"evictionDurationInSecs,omitempty"` EvictionTimestamp int `json:"evictionTimestamp,omitempty"` ServiceUpTimestamp int `json:"serviceUpTimestamp,omitempty"` }
type Port ¶
type Port struct { Port int `json:"$"` Enabled BoolString `json:"@enabled"` }