Documentation ¶
Overview ¶
Package resourceopt is an internal package that provides helper utilities for forming resource-options in resource packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOptions ¶
ApplyOptions applies the specified options to the input resource.
This function is defined here due to the Option interface providing an unexported field. This is needed so that the other packages using this can accumulate the options without having access to the unexported call.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is the definition of a resource Option used for creating and updating FHIR Resources.
func IncludeProtoField ¶
IncludeProtoField is a resource Option that appends the specified entries to the given 'field' in the proto. This function will panic if the given field is not a repeated field in the proto.
Note: This is an internal function intended to be used to form generic resource options that will work with all FHIR resources.
func WithCallback ¶
WithCallback returns a resource Option that simply passes the resource being created back into the specified callback. This exists to be built into larger, more strongly-typed options.
func WithProtoField ¶
WithProtoField is a resource Option that sets the specified 'field' in the proto to the values. If values is empty, the field is cleared. If values is not 1, and a field is not repeated, this functon will panic.
Note: This is an internal function intended to be used to form generic resource options that will work with all FHIR resources.