types

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateHash

func CalculateHash(s *Service) string

CalculateHash will calculate the configuration hash for the specified service. This hash will be used to compare versions of the service.

Types

type AcmeChallenge

type AcmeChallenge struct {
	Token string
	Auth  string
}

AcmeChallenge represents an ACME challenge.

type AcmeRegistration

type AcmeRegistration struct {
	Email        string
	PrivateKey   crypto.PrivateKey
	Registration *registration.Resource
}

AcmeRegistration contains all the information in relation to a complete ACME registration.

func (*AcmeRegistration) GetEmail

func (u *AcmeRegistration) GetEmail() string

func (*AcmeRegistration) GetPrivateKey

func (u *AcmeRegistration) GetPrivateKey() crypto.PrivateKey

func (*AcmeRegistration) GetRegistration

func (u *AcmeRegistration) GetRegistration() *registration.Resource

func (*AcmeRegistration) IsValid

func (u *AcmeRegistration) IsValid() bool

IsValid will return true when all required fields are available in the ACME registration.

type Certificate

type Certificate struct {
	Key           string        `json:"key"`
	Certificate   string        `json:"certificate"`
	ChallengeType ChallengeType `json:"challenge_type"`
}

func (*Certificate) CertificateBytes

func (c *Certificate) CertificateBytes() ([]byte, error)

CertificateBytes will return the bytes of the certificate.

func (*Certificate) Parse

func (c *Certificate) Parse() (*x509.Certificate, error)

Parse will return the first certificate of the bundle.

func (*Certificate) PrivateKeyBytes

func (c *Certificate) PrivateKeyBytes() ([]byte, error)

PrivateKeyBytes will return the bytes of the private key.

func (*Certificate) X509KeyPair

func (c *Certificate) X509KeyPair() (*tls.Certificate, error)

X509KeyPair will return the X509 key pair extracted from the certificate and private key.

type ChallengeType

type ChallengeType string
const (
	ChallengeTypeHTTP ChallengeType = "HTTP-01"
	ChallengeTypeDNS  ChallengeType = "DNS-01"
	ChallengeTypeTLS  ChallengeType = "TLS-ALPN-01"
	ChallengeTypeNone ChallengeType = "NONE"
)

type Ingress

type Ingress struct {
	Domain        string `json:"domain"`
	ContainerPort int    `json:"container_port"`

	TargetEndpoint string `json:"target_endpoint"`
	TargetService  string `json:"target_service"`
	TargetProject  string `json:"target_project"`

	ChallengeType ChallengeType `json:"challenge_type"`
}

type Quota

type Quota struct {
	MemoryLimit int64 `json:"memory_limit"`
}

type Service

type Service struct {
	Name           string            `json:"name"`
	Hash           string            `json:"hash"`
	ContainerName  string            `json:"container_name"`
	ContainerImage string            `json:"container_image"`
	Source         Source            `json:"source"`
	Environment    map[string]string `json:"environment"`
	Quota          Quota             `json:"quota"`
	Ingress        Ingress           `json:"ingress"`
}

type Source

type Source struct {
	Type string `json:"type"`
	URI  string `json:"uri"`
}

type ValidationError

type ValidationError struct {
	Reasons map[string]string
}

func (*ValidationError) Append

func (v *ValidationError) Append(field string, reason string)

Append will append a new reason to the validation error structure.

func (*ValidationError) Appendf

func (v *ValidationError) Appendf(field string, format string, args ...interface{})

Appendf will append a formatted reason to the validation error structure.

func (*ValidationError) Error

func (v *ValidationError) Error() string

func (*ValidationError) HasFailures

func (v *ValidationError) HasFailures() bool

HasFailures will return true if the validation error contains any reasons for failure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL