Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindProjectRoot ¶
FindProjectRoot discovers the nearest parent directory that contains go.mod.
Types ¶
type AuthHeader ¶
AuthHeader describes one generated auth-token header.
func EffectiveAuthHeaders ¶
func EffectiveAuthHeaders(mode AuthMode, headers []AuthHeader) ([]AuthHeader, error)
EffectiveAuthHeaders returns the validated auth headers used by token-based auth modes.
func NormalizeAuthHeaders ¶
func NormalizeAuthHeaders(headers []AuthHeader) ([]AuthHeader, error)
NormalizeAuthHeaders validates and canonicalizes user-provided auth headers.
type AuthMode ¶
type AuthMode uint8
AuthMode controls generated API auth wiring.
func ParseAuthMode ¶
ParseAuthMode parses user input into AuthMode.
func (AuthMode) MarshalJSON ¶
MarshalJSON encodes auth mode as string.
func (AuthMode) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*AuthMode) UnmarshalJSON ¶
UnmarshalJSON decodes auth mode from string.
func (*AuthMode) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Config ¶
type Config struct {
RootDir string
ModulePath string
ProfileName string
SpecPath string
APIOutDir string
RawClientModels bool
ModelsMode Mode
WrapperMode Mode
AuthMode AuthMode
AuthHeaders []AuthHeader
WrapperOutputPath string
WrapperPackage string
AttachmentRedactedFields []string
AttachmentRedactionReplacement string
}
type DomainProfile ¶
type DomainProfile struct {
// Optional. If empty, registry key is used as domain.
Domain string
SpecPath string
// Optional overrides.
APIOutDir string
WrapperOutputPath string
WrapperPackage string
RawClientModels bool
ModelsMode Mode
AuthMode AuthMode
AuthHeaders []AuthHeader
AttachmentRedactedFields []string
AttachmentRedactionReplacement string
}
DomainProfile is a compact profile format: only domain + spec are required, the rest is derived by convention.
func NewDomainProfile ¶
func NewDomainProfile(domain, specPath string) DomainProfile
NewDomainProfile creates compact domain profile with required domain and spec path.
func (DomainProfile) ToProfile ¶
func (p DomainProfile) ToProfile() (Profile, error)
ToProfile converts compact profile to full profile using its own Domain field.
type Mode ¶
type Mode uint8
Mode controls generation behavior for entity and wrapper artifacts.
func (Mode) MarshalJSON ¶
MarshalJSON encodes mode as string.
func (Mode) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Mode) UnmarshalJSON ¶
UnmarshalJSON decodes mode from string.
func (*Mode) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Registry ¶
func BuildRegistryFromDomainProfiles ¶
func BuildRegistryFromDomainProfiles(defaultProfile string, profiles map[string]DomainProfile) (Registry, error)
BuildRegistryFromDomainProfiles resolves compact profiles to full registry profiles.
func (Registry) AvailableProfiles ¶
AvailableProfiles returns known registry profiles in deterministic order.