Documentation
¶
Index ¶
- type API
- func (a *API) CreateClient(w http.ResponseWriter, r *http.Request)
- func (a *API) DeleteClient(w http.ResponseWriter, r *http.Request)
- func (a *API) GetClient(w http.ResponseWriter, r *http.Request)
- func (a *API) ListClients(w http.ResponseWriter, r *http.Request)
- func (a *API) RegisterEndpoints(mux *chi.Mux)
- func (a *API) UpdateClient(w http.ResponseWriter, r *http.Request)
- func (a *API) WriteJSONResponse(w http.ResponseWriter, data interface{}, msg string, status int, ...)
- type ErrorOAuth2
- type HydraClientInterface
- type ListClientsRequest
- type OAuth2Client
- type PaginationLinksMeta
- type PaginationLinksResponse
- type PaginationMeta
- type Service
- func (s *Service) CreateClient(ctx context.Context, client *hClient.OAuth2Client) (*ServiceResponse, error)
- func (s *Service) DeleteClient(ctx context.Context, clientID string) (*ServiceResponse, error)
- func (s *Service) GetClient(ctx context.Context, clientID string) (*ServiceResponse, error)
- func (s *Service) ListClients(ctx context.Context, cs *ListClientsRequest) (*ServiceResponse, error)
- func (s *Service) UnmarshalClient(data []byte) (*hClient.OAuth2Client, error)
- func (s *Service) UpdateClient(ctx context.Context, client *hClient.OAuth2Client) (*ServiceResponse, error)
- type ServiceInterface
- type ServiceResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(service ServiceInterface, logger logging.LoggerInterface) *API
func (*API) CreateClient ¶
func (a *API) CreateClient(w http.ResponseWriter, r *http.Request)
func (*API) DeleteClient ¶
func (a *API) DeleteClient(w http.ResponseWriter, r *http.Request)
func (*API) ListClients ¶
func (a *API) ListClients(w http.ResponseWriter, r *http.Request)
func (*API) RegisterEndpoints ¶
func (a *API) RegisterEndpoints(mux *chi.Mux)
func (*API) UpdateClient ¶
func (a *API) UpdateClient(w http.ResponseWriter, r *http.Request)
func (*API) WriteJSONResponse ¶
func (a *API) WriteJSONResponse(w http.ResponseWriter, data interface{}, msg string, status int, links interface{}, meta interface{})
type ErrorOAuth2 ¶
type HydraClientInterface ¶
type ListClientsRequest ¶
type ListClientsRequest struct { PaginationMeta Owner string `json:"owner,omitempty"` ClientName string `json:"client_name,omitempty"` }
func NewListClientsRequest ¶
func NewListClientsRequest(cn, owner, page string, size int) *ListClientsRequest
type OAuth2Client ¶
type OAuth2Client = hClient.OAuth2Client
type PaginationLinksMeta ¶
type PaginationLinksMeta struct { First PaginationMeta `json:"first,omitempty"` Last PaginationMeta `json:"last,omitempty"` Prev PaginationMeta `json:"prev,omitempty"` Next PaginationMeta `json:"next,omitempty"` }
type PaginationLinksResponse ¶
type PaginationMeta ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(hydra HydraClientInterface, tracer trace.Tracer, monitor monitoring.MonitorInterface, logger logging.LoggerInterface) *Service
func (*Service) CreateClient ¶
func (s *Service) CreateClient(ctx context.Context, client *hClient.OAuth2Client) (*ServiceResponse, error)
func (*Service) DeleteClient ¶
func (*Service) ListClients ¶
func (s *Service) ListClients(ctx context.Context, cs *ListClientsRequest) (*ServiceResponse, error)
func (*Service) UnmarshalClient ¶
func (s *Service) UnmarshalClient(data []byte) (*hClient.OAuth2Client, error)
func (*Service) UpdateClient ¶
func (s *Service) UpdateClient(ctx context.Context, client *hClient.OAuth2Client) (*ServiceResponse, error)
type ServiceInterface ¶
type ServiceInterface interface { GetClient(context.Context, string) (*ServiceResponse, error) CreateClient(context.Context, *hClient.OAuth2Client) (*ServiceResponse, error) UpdateClient(context.Context, *hClient.OAuth2Client) (*ServiceResponse, error) ListClients(context.Context, *ListClientsRequest) (*ServiceResponse, error) DeleteClient(context.Context, string) (*ServiceResponse, error) UnmarshalClient(data []byte) (*hClient.OAuth2Client, error) }
type ServiceResponse ¶
type ServiceResponse struct { Links *PaginationLinksMeta ServiceError *ErrorOAuth2 Resp interface{} Meta map[string]string }
func NewServiceResponse ¶
func NewServiceResponse() *ServiceResponse
Click to show internal directories.
Click to hide internal directories.