Documentation
¶
Index ¶
- type Provider
- func (p *Provider) ContentType() string
- func (p *Provider) EnableReflection()
- func (p *Provider) Endpoint() string
- func (p *Provider) Generate(ctx context.Context, app farp.Application) (any, error)
- func (p *Provider) GenerateDescriptor(ctx context.Context, app farp.Application, locationType farp.LocationType, ...) (*farp.SchemaDescriptor, error)
- func (p *Provider) Hash(schema any) (string, error)
- func (p *Provider) Serialize(schema any) ([]byte, error)
- func (p *Provider) SetProtoFiles(files []string)
- func (p *Provider) SpecVersion() string
- func (p *Provider) Type() farp.SchemaType
- func (p *Provider) Validate(schema any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider generates gRPC schemas (FileDescriptorSet) from applications.
func NewProvider ¶
NewProvider creates a new gRPC schema provider specVersion should be "proto3" (recommended) or "proto2" endpoint is typically empty for gRPC (uses reflection).
func (*Provider) ContentType ¶
ContentType returns the content type Can be "application/x-protobuf" for binary or "application/json" for JSON representation.
func (*Provider) EnableReflection ¶
func (p *Provider) EnableReflection()
EnableReflection configures the provider to use gRPC reflection.
func (*Provider) Generate ¶
Generate generates a gRPC schema (FileDescriptorSet) from the application.
func (*Provider) GenerateDescriptor ¶
func (p *Provider) GenerateDescriptor(ctx context.Context, app farp.Application, locationType farp.LocationType, locationConfig map[string]string) (*farp.SchemaDescriptor, error)
GenerateDescriptor generates a complete SchemaDescriptor for this schema.
func (*Provider) SetProtoFiles ¶
SetProtoFiles sets the .proto files to parse.
func (*Provider) SpecVersion ¶
SpecVersion returns the Protocol Buffer version.