Documentation
¶
Overview ¶
Package families opens a client for whichever forge family answers at a connection.
It is the one package that imports all three family packages: the root package imports none, so a consumer can depend on the vocabulary alone, and a registry filled by package initializers is a global this library does not build. A consumer that knows its family calls that family's constructor and pays nothing for detection.
Open answers under the root package's three-way error contract: nil, a *forgeapi.Error, or a context sentinel returned unchanged. Detection's own failure is forgeapi.CodeFamilyUndetected, and it is not a context failure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
func Open(ctx context.Context, conn forgeapi.Connection, opts ...forgeapi.Option) (forgeapi.Core, forgeapi.Family, error)
Open asks GitLab's connection read, then GitHub's, then the Gitea family's, and answers the first family it establishes with its client, capabilities held, at that read plus one request per family asked first (at most 2, 3 and 5), on no budget the caller holds. Every failure answers forgeapi.FamilyUnknown: no family established is forgeapi.CodeFamilyUndetected with the last read's status and figures; a context ending, a constructor's refusal, a refused attempt and a governor deferral return unchanged and ask no later family. Open closes all but its answer.
Types ¶
This section is empty.