Documentation
¶
Index ¶
Constants ¶
View Source
const MetadataTeamIDKey = "team_id"
Variables ¶
View Source
var ( ErrNotFound = fmt.Errorf("gateway: %w", commonerrors.ErrNotFound) ErrAlreadyExists = fmt.Errorf("gateway: %w", commonerrors.ErrAlreadyExists) ErrHasDependents = fmt.Errorf("gateway: %w", commonerrors.ErrHasDependents) ErrInvalidDomain = fmt.Errorf("gateway: invalid domain: %w", commonerrors.ErrValidation) )
Sentinel errors for the gateway aggregate. They wrap the package-wide sentinels in pkg/common/errors so callers can match either the generic or the entity-specific error via errors.Is.
Functions ¶
func IsValidSlug ¶
func NormalizeDomain ¶
func NormalizeSlug ¶
func SlugFromName ¶
Types ¶
type ClientTLSConfig ¶
type ClientTLSConfig map[string]json.RawMessage
func (*ClientTLSConfig) Scan ¶
func (c *ClientTLSConfig) Scan(value interface{}) error
type Gateway ¶
type Gateway struct {
ID ids.GatewayID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Status string `json:"status"`
Domain string `json:"domain,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Telemetry *telemetry.Telemetry `json:"telemetry,omitempty"`
ClientTLSConfig ClientTLSConfig `json:"client_tls,omitempty"`
SessionConfig *SessionConfig `json:"session_config,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func Rehydrate ¶
func Rehydrate( id ids.GatewayID, name, status, domain string, tel *telemetry.Telemetry, clientTLS ClientTLSConfig, session *SessionConfig, createdAt, updatedAt time.Time, ) *Gateway
func RehydrateWithSlug ¶
func RehydrateWithSlug( id ids.GatewayID, name, slug, status string, tel *telemetry.Telemetry, clientTLS ClientTLSConfig, session *SessionConfig, createdAt, updatedAt time.Time, ) *Gateway
type ListFilter ¶
type Repository ¶
type Repository interface {
Save(ctx context.Context, g *Gateway) error
Update(ctx context.Context, g *Gateway) error
Delete(ctx context.Context, id ids.GatewayID) error
FindByID(ctx context.Context, id ids.GatewayID) (*Gateway, error)
FindByDomain(ctx context.Context, domain string) (*Gateway, error)
FindBySlug(ctx context.Context, slug string) (*Gateway, error)
List(ctx context.Context, filter ListFilter) (items []*Gateway, total int, err error)
}
type SessionConfig ¶
type SessionConfig struct {
Enabled *bool `json:"enabled,omitempty"`
HeaderName string `json:"header_name,omitempty"`
BodyParamName string `json:"body_param_name,omitempty"`
}
func DefaultSessionConfig ¶
func DefaultSessionConfig() *SessionConfig
func (*SessionConfig) IsEnabled ¶
func (s *SessionConfig) IsEnabled() bool
Click to show internal directories.
Click to hide internal directories.