Documentation ¶
Overview ¶
Package apix provide API-related helpers.
Package apix is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrAccessTokenInvalid = errors.New("invalid AccessToken")
)
Errors.
Functions ¶
Types ¶
type AccessToken ¶
type AccessToken string
AccessToken is an access token.
func AccessTokenFromContext ¶ added in v0.3.0
func AccessTokenFromContext(ctx Ctx) (accessToken AccessToken)
AccessTokenFromContext returns AccessToken stored in ctx, if any.
func (AccessToken) Format ¶ added in v0.3.0
func (s AccessToken) Format(f fmt.State, c rune)
Format wraps sensitive.String.
func (AccessToken) MarshalJSON ¶ added in v0.3.0
func (s AccessToken) MarshalJSON() ([]byte, error)
MarshalJSON wraps sensitive.String.
func (AccessToken) MarshalText ¶ added in v0.3.0
func (s AccessToken) MarshalText() ([]byte, error)
MarshalText wraps sensitive.String.
type Authn ¶
type Authn interface { // Authenticate validates AccessToken and returns corresponding // Auth. If validation fails returns zero Auth with error. // // Errors: ErrAccessTokenInvalid. Authenticate(Ctx, AccessToken) (dom.Auth, error) }
Authn validates AccessToken.
type JSONRPC2Ctx ¶ added in v0.3.0
JSONRPC2Ctx describe JSON-RPC 2.0 Ctx param used by all API methods.
func (*JSONRPC2Ctx) NewContext ¶ added in v0.3.0
func (c *JSONRPC2Ctx) NewContext( authn Authn, service string, ) ( ctx Ctx, log *structlog.Logger, methodName string, auth dom.Auth, err error, )
NewContext returns a new context.Context that carries values describing this request without any deadline, plus some of the values.
type MockAuthn ¶
type MockAuthn struct {
// contains filtered or unexported fields
}
MockAuthn is a mock of Authn interface
func NewMockAuthn ¶
func NewMockAuthn(ctrl *gomock.Controller) *MockAuthn
NewMockAuthn creates a new mock instance
func (*MockAuthn) Authenticate ¶
Authenticate mocks base method
func (*MockAuthn) EXPECT ¶
func (m *MockAuthn) EXPECT() *MockAuthnMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockAuthnMockRecorder ¶
type MockAuthnMockRecorder struct {
// contains filtered or unexported fields
}
MockAuthnMockRecorder is the mock recorder for MockAuthn
func (*MockAuthnMockRecorder) Authenticate ¶
func (mr *MockAuthnMockRecorder) Authenticate(arg0, arg1 interface{}) *gomock.Call
Authenticate indicates an expected call of Authenticate