Documentation ¶
Index ¶
- func AsPtr[T any](in T) *T
- func ChannelDoOnEvent(of Channel, what func())
- func CorrelationIdOfRequest(req *http.Request) any
- func CreateDummyCertificate() (tls.Certificate, error)
- func CreateDummyCertificateFor(name string) (tls.Certificate, error)
- func CreatePrivateKey() (interface{}, error)
- func FlagEnvName(appPrefix, name string) string
- func FlagEnvNameNormalize(what string) string
- func HostOfRequest(req *http.Request) any
- func Join(sep string, what ...interface{}) string
- func Must(err error)
- func NegotiateContentType(requestedAccept string, offers []string) string
- func NegotiateContentTypeOf(req *http.Request, offers ...string) string
- func NormalizeHeaderContent(val string) string
- func PathOfRequest(req *http.Request) string
- func PublicKeyOf(candidate interface{}) interface{}
- func QuoteAllIfNeeded(in ...string) []string
- func QuoteAndJoin(in ...string) string
- func QuoteIfNeeded(what string) string
- func RemoteIpOfRequest(req *http.Request) any
- func RequestBasedLazyFor(req *http.Request, delegate func(*http.Request) any) fields.Lazy
- func RequestIdOfRequest(req *http.Request) string
- func SplitExt(in string) (path, ext string)
- func ToChan(channel Channel) chan struct{}
- func UriOfRequest(req *http.Request) any
- func UserAgentOfRequest(req *http.Request) string
- func UserAgentOfRequestAny(req *http.Request) any
- type AcceptRange
- type Channel
- type FlagEnabled
- type GenericResponse
- func (this GenericResponse) StreamJsonTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
- func (this GenericResponse) StreamXmlTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
- func (this GenericResponse) StreamYamlTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
- func (this GenericResponse) WithData(data interface{}) GenericResponse
- type Initializable
- type ObjectReference
- type ObjectReferenceSource
- type RuntimeT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelDoOnEvent ¶
func ChannelDoOnEvent(of Channel, what func())
func CorrelationIdOfRequest ¶ added in v0.1.12
func CreateDummyCertificate ¶
func CreateDummyCertificate() (tls.Certificate, error)
func CreateDummyCertificateFor ¶ added in v0.1.18
func CreateDummyCertificateFor(name string) (tls.Certificate, error)
func CreatePrivateKey ¶
func CreatePrivateKey() (interface{}, error)
func FlagEnvName ¶
func FlagEnvNameNormalize ¶
func HostOfRequest ¶
func NegotiateContentType ¶
func NegotiateContentTypeOf ¶
func NormalizeHeaderContent ¶
func PathOfRequest ¶
func PublicKeyOf ¶
func PublicKeyOf(candidate interface{}) interface{}
func QuoteAllIfNeeded ¶
func QuoteAndJoin ¶
func QuoteIfNeeded ¶
func RemoteIpOfRequest ¶
func RequestBasedLazyFor ¶ added in v0.7.0
func RequestIdOfRequest ¶
func UriOfRequest ¶
func UserAgentOfRequest ¶
func UserAgentOfRequestAny ¶ added in v0.7.0
Types ¶
type AcceptRange ¶
type AcceptRange struct { // Type represents the media type. Type string // Subtype represents the media subtype. Subtype string // Weight represents the weight (quality factor) of this range. Weight float64 // Parameters represents the parameters that are applicable to this range. Parameters map[string]string // contains filtered or unexported fields }
AcceptRange represents a media-range contained within an Accept header.
func ParseAcceptRange ¶
func ParseAcceptRange(accept string) AcceptRange
ParseAcceptRange returns the media range, params and quality factor (weight) from an Accept range.
func ParseAcceptRanges ¶
func ParseAcceptRanges(accepts string) []AcceptRange
ParseAcceptRanges returns the set of accepted media ranges from an Accept header.
func (AcceptRange) RawString ¶
func (a AcceptRange) RawString() string
RawString returns the raw string for this accept range.
type Channel ¶
type Channel interface { Wait() Broadcast() }
func NewChannel ¶
func NewChannel() Channel
type FlagEnabled ¶
type FlagEnabled interface {
Flag(name, help string) *kingpin.FlagClause
}
type GenericResponse ¶
type GenericResponse struct { XMLName xml.Name `json:"-" yaml:"-" xml:"response"` Timestamp string `json:"timestamp" yaml:"timestamp" xml:"timestamp"` Status int `json:"status" yaml:"status" xml:"status"` Message string `json:"message,omitempty" yaml:"message,omitempty" xml:"message,omitempty"` Path string `json:"path" yaml:"path" xml:"path"` RequestId string `json:"requestId,omitempty" yaml:"requestId,omitempty" xml:"requestId,omitempty"` CorrelationId string `json:"correlationId,omitempty" yaml:"correlationId,omitempty" xml:"correlationId,omitempty"` Data interface{} `json:"data,omitempty" yaml:"data,omitempty" xml:"data,omitempty"` ErrorHandler func(resp http.ResponseWriter, req *http.Request, message string, err error, status int) }
func NewGenericResponse ¶
func NewGenericResponse(statusCode int, message string, req *http.Request) GenericResponse
func (GenericResponse) StreamJsonTo ¶
func (this GenericResponse) StreamJsonTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
func (GenericResponse) StreamXmlTo ¶
func (this GenericResponse) StreamXmlTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
func (GenericResponse) StreamYamlTo ¶
func (this GenericResponse) StreamYamlTo(resp http.ResponseWriter, req *http.Request, logProvider func() log.Logger)
func (GenericResponse) WithData ¶
func (this GenericResponse) WithData(data interface{}) GenericResponse
type Initializable ¶ added in v0.1.7
type ObjectReference ¶ added in v0.7.0
type ObjectReference interface { ApiVersion() string Kind() string Namespace() string Name() string String() string ShortString() string Equals(ObjectReference) bool WithNamespace(string) ObjectReference WithName(string) ObjectReference WithGroupVersionKind(schema.GroupVersionKind) ObjectReference WithApiVersionAndKind(apiVersion, king string) ObjectReference GroupVersionKind() schema.GroupVersionKind }
func NewObjectReferenceOf ¶ added in v0.7.0
func NewObjectReferenceOf(src ObjectReferenceSource) (ObjectReference, error)
type ObjectReferenceSource ¶ added in v0.7.0
type RuntimeT ¶
type RuntimeT struct { Revision string `yaml:"revision" json:"revision"` Branch string `yaml:"branch" json:"branch"` Build time.Time `yaml:"build" json:"build"` GoVersion string `yaml:"goVersion" json:"goVersion"` Os string `yaml:"os" json:"os"` Arch string `yaml:"arch" json:"arch"` }
RuntimeT hold the runtime information about this application. To provide the correct information to also enable the usage of:
Runtime()
...you have to call the build process with the correct parameters. We have build for that a small utility that escapes everything in the right order:
go run github.com/echocat/lingress/build \ -b <branch> \ -b <revision> \ -o <output> \ [<package>] # Default ./
Example:
go run github.com/echocat/lingress/build \ -g travel-the-pipe \ -a some-backend \ -b $BRANCH \ -b $REVISION \ -o out/app \ ./
func (RuntimeT) LongString ¶ added in v0.7.0
func (RuntimeT) MarshalText ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.