go-api-boilerplate: github.com/vardius/go-api-boilerplate/cmd/auth/internal/infrastructure/persistence Index | Files | Directories

package persistence

import "github.com/vardius/go-api-boilerplate/cmd/auth/internal/infrastructure/persistence"

Package persistence holds view models and repository interfaces

Package persistence holds view models and repository interfaces

Package persistence holds view models and repository interfaces

Index

Package Files

client.go token.go user.go

type Client Uses

type Client interface {
    GetID() string
    GetUserID() string
    GetSecret() string
    GetDomain() string
    GetData() json.RawMessage
}

Client the client persistence model interface

type ClientRepository Uses

type ClientRepository interface {
    Get(ctx context.Context, id string) (Client, error)
    Add(ctx context.Context, client Client) error
    Delete(ctx context.Context, id string) error
}

ClientRepository allows to get/save current state of user to mysql storage

type Token Uses

type Token interface {
    GetID() string
    GetClientID() string
    GetUserID() string
    GetAccess() string
    GetRefresh() string
    GetScope() string
    GetCode() string
    GetData() json.RawMessage
}

Token the token persistence model interface

type TokenRepository Uses

type TokenRepository interface {
    Get(ctx context.Context, id string) (Token, error)
    GetByCode(ctx context.Context, code string) (Token, error)
    GetByAccess(ctx context.Context, access string) (Token, error)
    GetByRefresh(ctx context.Context, refresh string) (Token, error)
    Add(ctx context.Context, token Token) error
    Delete(ctx context.Context, id string) error
}

TokenRepository allows to get/save current state of token to mysql storage

type User Uses

type User interface {
    GetID() string
    GetEmail() string
}

User the user persistence model interface

type UserRepository Uses

type UserRepository interface {
    Get(ctx context.Context, id string) (User, error)
}

UserRepository allows to get/save current state of user to mysql storage

Directories

PathSynopsis
mysqlPackage mysql holds view model repositories

Package persistence imports 2 packages (graph) and is imported by 3 packages. Updated 2020-08-04. Refresh now. Tools for package owners.