Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateServiceStructs = errRange.New( "Multiple service structs found", "Multiple service structs were found in the same service. Encore only allows one service struct to be defined per service.", ) ErrReceiverNotAServiceStruct = errRange.New( "Invalid service struct for API", "API endpoints defined as receiver functions must be defined on a service struct.", ) ErrServiceStructReferencedInAnotherService = errRange.New( "Service struct referenced in another service", "Service structs cannot be referenced in other services. They can only be referenced in the service that defines them.", ) )
Functions ¶
func ResolveServiceStructUsage ¶
func ResolveServiceStructUsage(data usage.ResolveData, s *ServiceStruct) usage.Usage
Types ¶
type ServiceStruct ¶
type ServiceStruct struct { Decl *schema.TypeDecl // decl is the type declaration Doc string // Init is the function for initializing this group. // It is nil if there is no initialization function. Init option.Option[*schema.FuncDecl] }
ServiceStruct describes a dependency injection struct for a service.
func Parse ¶
func Parse(d ParseData) *ServiceStruct
Parse parses the service struct in the provided type declaration.
func (*ServiceStruct) End ¶
func (ss *ServiceStruct) End() token.Pos
func (*ServiceStruct) Kind ¶
func (ss *ServiceStruct) Kind() resource.Kind
func (*ServiceStruct) Package ¶
func (ss *ServiceStruct) Package() *pkginfo.Package
func (*ServiceStruct) Pos ¶
func (ss *ServiceStruct) Pos() token.Pos
func (*ServiceStruct) SortKey ¶ added in v1.16.3
func (ss *ServiceStruct) SortKey() string
type Usage ¶
type Usage struct { usage.Base ServiceStruct *ServiceStruct }
Click to show internal directories.
Click to hide internal directories.