Implemented remaining transport layer methods; added logging middleware;

added Dockerfile; added gen cert Makefile cmds; added Redis repo
This commit is contained in:
mitchell 2019-05-05 17:56:27 -07:00
parent 719a462048
commit c289eecd54
20 changed files with 1977 additions and 143 deletions

View file

@ -1,8 +1,9 @@
package types
import "time"
import (
"time"
)
// Credential TODO
type Credential struct {
Metadata
Username string
@ -10,7 +11,6 @@ type Credential struct {
Password string
}
// CredentialInput TODO
type CredentialInput struct {
MetadataInput
Username string
@ -18,17 +18,15 @@ type CredentialInput struct {
Password string
}
// Metadata TODO
type Metadata struct {
ID string
ID string // primary key
SourceHost string // sort key
CreatedAt time.Time
UpdatedAt time.Time
Primary string
SourceHost string
LoginURL string
}
// MetadataInput TODO
type MetadataInput struct {
Primary string
SourceHost string

View file

@ -2,19 +2,19 @@ package types
import "context"
// Service TODO
type Service interface {
GetAllMetadata(ctx context.Context, sourceService string) (output <-chan Metadata, errch chan error)
GetAllMetadata(ctx context.Context, sourceHost string) (output <-chan Metadata, errch chan error)
Get(ctx context.Context, id string) (output Credential, err error)
Create(ctx context.Context, ci CredentialInput) (output Credential, err error)
Update(ctx context.Context, id string, ci CredentialInput) (output Credential, err error)
Delete(ctx context.Context, id string) (err error)
DumpDB(ctx context.Context) (bs []byte, err error)
}
// CredentialRepo TODO
type CredentialRepo interface {
GetAllMetadata(ctx context.Context, sourceService string, errch chan<- error) (output <-chan Metadata)
GetAllMetadata(ctx context.Context, sourceHost string, errch chan<- error) (output <-chan Metadata)
Get(ctx context.Context, id string) (output Credential, err error)
Put(ctx context.Context, c Credential) (err error)
Delete(ctx context.Context, id string) (err error)
DumpDB(ctx context.Context) (bs []byte, err error)
}