Documentation ¶
Overview ¶
Package context is a generated GoMock package.
Index ¶
- type Adapter
- func (a *Adapter) Bind(v interface{}) error
- func (a *Adapter) Context() *gofr.Context
- func (a *Adapter) GetAPIKey() (string, bool)
- func (a *Adapter) GetClaim(key string) (interface{}, bool)
- func (a *Adapter) GetStringClaim(key string) (string, bool)
- func (a *Adapter) GetUUIDClaim(key string) (uuid.UUID, bool)
- func (a *Adapter) SetClaim(key string, value interface{})
- type Context
- type CustomContext
- func (c *CustomContext) Bind(v interface{}) error
- func (c *CustomContext) Context() *gofr.Context
- func (c *CustomContext) GetAPIKey() (string, bool)
- func (c *CustomContext) GetClaim(key string) (interface{}, bool)
- func (c *CustomContext) GetHeader(key string) string
- func (c *CustomContext) GetStringClaim(key string) (string, bool)
- func (c *CustomContext) GetUUIDClaim(key string) (uuid.UUID, bool)
- func (c *CustomContext) Headers() http.Header
- func (c *CustomContext) SetClaim(key string, value interface{})
- func (c *CustomContext) SetHeader(key, value string)
- type MockContext
- func (m *MockContext) Bind(arg0 any) error
- func (m *MockContext) Context() *gofr.Context
- func (m *MockContext) EXPECT() *MockContextMockRecorder
- func (m *MockContext) GetAPIKey() (string, bool)
- func (m *MockContext) GetClaim(arg0 string) (any, bool)
- func (m *MockContext) GetStringClaim(arg0 string) (string, bool)
- func (m *MockContext) GetUUIDClaim(arg0 string) (uuid.UUID, bool)
- func (m *MockContext) SetClaim(arg0 string, arg1 any)
- type MockContextMockRecorder
- func (mr *MockContextMockRecorder) Bind(arg0 any) *gomock.Call
- func (mr *MockContextMockRecorder) Context() *gomock.Call
- func (mr *MockContextMockRecorder) GetAPIKey() *gomock.Call
- func (mr *MockContextMockRecorder) GetClaim(arg0 any) *gomock.Call
- func (mr *MockContextMockRecorder) GetStringClaim(arg0 any) *gomock.Call
- func (mr *MockContextMockRecorder) GetUUIDClaim(arg0 any) *gomock.Call
- func (mr *MockContextMockRecorder) SetClaim(arg0, arg1 any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct { MockContext *MockContext GofrContext *gofr.Context }
Adapter is a test helper that implements customctx.Context
type CustomContext ¶
type CustomContext struct {
// contains filtered or unexported fields
}
func NewCustomContext ¶
func NewCustomContext(c *gofr.Context) *CustomContext
NewCustomContext creates a new Context.
func (*CustomContext) Bind ¶
func (c *CustomContext) Bind(v interface{}) error
Bind binds the input to the given value.
func (*CustomContext) Context ¶
func (c *CustomContext) Context() *gofr.Context
Context returns the underlying gofr.Context.
func (*CustomContext) GetAPIKey ¶
func (c *CustomContext) GetAPIKey() (string, bool)
GetAPIKey returns the API key from the context.
func (*CustomContext) GetClaim ¶
func (c *CustomContext) GetClaim(key string) (interface{}, bool)
GetClaim returns the claim value.
func (*CustomContext) GetHeader ¶
func (c *CustomContext) GetHeader(key string) string
GetHeader retrieves an HTTP header value.
func (*CustomContext) GetStringClaim ¶
func (c *CustomContext) GetStringClaim(key string) (string, bool)
GetStringClaim returns the claim value as a string.
func (*CustomContext) GetUUIDClaim ¶
func (c *CustomContext) GetUUIDClaim(key string) (uuid.UUID, bool)
GetUUIDClaim returns the claim value as a UUID.
func (*CustomContext) Headers ¶
func (c *CustomContext) Headers() http.Header
Headers returns all HTTP headers.
func (*CustomContext) SetClaim ¶
func (c *CustomContext) SetClaim(key string, value interface{})
SetClaim sets the claim value.
func (*CustomContext) SetHeader ¶
func (c *CustomContext) SetHeader(key, value string)
SetHeader sets an HTTP header.
type MockContext ¶
type MockContext struct {
// contains filtered or unexported fields
}
MockContext is a mock of Context interface.
func NewMockContext ¶
func NewMockContext(ctrl *gomock.Controller) *MockContext
NewMockContext creates a new mock instance.
func (*MockContext) Context ¶
func (m *MockContext) Context() *gofr.Context
Context mocks base method.
func (*MockContext) EXPECT ¶
func (m *MockContext) EXPECT() *MockContextMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockContext) GetAPIKey ¶
func (m *MockContext) GetAPIKey() (string, bool)
GetAPIKey mocks base method.
func (*MockContext) GetClaim ¶
func (m *MockContext) GetClaim(arg0 string) (any, bool)
GetClaim mocks base method.
func (*MockContext) GetStringClaim ¶
func (m *MockContext) GetStringClaim(arg0 string) (string, bool)
GetStringClaim mocks base method.
func (*MockContext) GetUUIDClaim ¶
func (m *MockContext) GetUUIDClaim(arg0 string) (uuid.UUID, bool)
GetUUIDClaim mocks base method.
func (*MockContext) SetClaim ¶
func (m *MockContext) SetClaim(arg0 string, arg1 any)
SetClaim mocks base method.
type MockContextMockRecorder ¶
type MockContextMockRecorder struct {
// contains filtered or unexported fields
}
MockContextMockRecorder is the mock recorder for MockContext.
func (*MockContextMockRecorder) Bind ¶
func (mr *MockContextMockRecorder) Bind(arg0 any) *gomock.Call
Bind indicates an expected call of Bind.
func (*MockContextMockRecorder) Context ¶
func (mr *MockContextMockRecorder) Context() *gomock.Call
Context indicates an expected call of Context.
func (*MockContextMockRecorder) GetAPIKey ¶
func (mr *MockContextMockRecorder) GetAPIKey() *gomock.Call
GetAPIKey indicates an expected call of GetAPIKey.
func (*MockContextMockRecorder) GetClaim ¶
func (mr *MockContextMockRecorder) GetClaim(arg0 any) *gomock.Call
GetClaim indicates an expected call of GetClaim.
func (*MockContextMockRecorder) GetStringClaim ¶
func (mr *MockContextMockRecorder) GetStringClaim(arg0 any) *gomock.Call
GetStringClaim indicates an expected call of GetStringClaim.
func (*MockContextMockRecorder) GetUUIDClaim ¶
func (mr *MockContextMockRecorder) GetUUIDClaim(arg0 any) *gomock.Call
GetUUIDClaim indicates an expected call of GetUUIDClaim.