Documentation
¶
Index ¶
- Constants
- func IsInvalidConfig(err error) bool
- func IsInvalidRequest(err error) bool
- func IsNotFound(err error) bool
- type Config
- type Endpoint
- func (e *Endpoint) Decoder() kithttp.DecodeRequestFunc
- func (e *Endpoint) Encoder() kithttp.EncodeResponseFunc
- func (e *Endpoint) Endpoint() kitendpoint.Endpoint
- func (e *Endpoint) Method() string
- func (e *Endpoint) Middlewares() []kitendpoint.Middleware
- func (e *Endpoint) Name() string
- func (e *Endpoint) Path() string
- type PathParams
- type Request
- type Response
Constants ¶
View Source
const ( // Method is the HTTP method this endpoint is registered for. Method = "GET" // Name identifies the endpoint. It is aligned to the package path. Name = "imds/instance/getter/" // Path is the HTTP request path this endpoint is registered for. Path = "/imds/instance/{subscription_id}/{resource_group_name}/{vmss_name}/{instance_id}/" )
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsInvalidRequest ¶
IsInvalidRequest asserts invalidRequestError.
Types ¶
type Config ¶
type Config struct { Logger micrologger.Logger Middleware *middleware.Middleware InstanceService *instance.Service }
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func (*Endpoint) Decoder ¶
func (e *Endpoint) Decoder() kithttp.DecodeRequestFunc
Decoder decodes the incoming request.
func (*Endpoint) Encoder ¶
func (e *Endpoint) Encoder() kithttp.EncodeResponseFunc
Encoder encodes the outgoing response.
func (*Endpoint) Endpoint ¶
func (e *Endpoint) Endpoint() kitendpoint.Endpoint
Endpoint is where the actual request gets sent off to a service package that does some business logic.
func (*Endpoint) Method ¶
Method returns what HTTP verb this endpoint accepts. These are defined as consts above.
func (*Endpoint) Middlewares ¶
func (e *Endpoint) Middlewares() []kitendpoint.Middleware
Middlewares returns a slice of the middlewares used in this endpoint.
type PathParams ¶
type PathParams struct { SubscriptionID string ResourceGroupName string VMSSName string InstanceID string }
PathParams hold the parameters we get from the URL.
type Request ¶
type Request struct {
PathParams PathParams
}
Request represents the path and body parameters coming in to this endpoint.
GET /imds/instance/{subscription_id}/{resource_group}/{vmss_name}/{instance_id}/
Click to show internal directories.
Click to hide internal directories.