Working auth and photo json endpoint

Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
Kris Nóva 2021-02-09 11:17:06 -08:00
parent ef275f97f4
commit e4323b6047
2032 changed files with 821464 additions and 52 deletions

View file

@ -0,0 +1,40 @@
package exifundefined
import log "github.com/dsoprea/go-logging"
// UndefinedTagHandle defines one undefined-type tag with a corresponding
// decoder.
type UndefinedTagHandle struct {
IfdPath string
TagId uint16
}
func registerEncoder(entity EncodeableValue, encoder UndefinedValueEncoder) {
typeName := entity.EncoderName()
_, found := encoders[typeName]
if found == true {
log.Panicf("encoder already registered: %v", typeName)
}
encoders[typeName] = encoder
}
func registerDecoder(ifdPath string, tagId uint16, decoder UndefinedValueDecoder) {
uth := UndefinedTagHandle{
IfdPath: ifdPath,
TagId: tagId,
}
_, found := decoders[uth]
if found == true {
log.Panicf("decoder already registered: %v", uth)
}
decoders[uth] = decoder
}
var (
encoders = make(map[string]UndefinedValueEncoder)
decoders = make(map[UndefinedTagHandle]UndefinedValueDecoder)
)