Documentation ¶
Overview ¶
Package pb is a generated protocol buffer package.
It is generated from these files:
controller.proto
It has these top-level messages:
SetRequest SetResponse ResetRequest ResetResponse GetReportsRequest GetReportsResponse
Index ¶
- Constants
- func RegisterControllerServiceServer(s *grpc.Server, srv ControllerServiceServer)
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) CloseSession(ctx context.Context, req *v1beta1.CloseSessionRequest) (*v1beta1.CloseSessionResponse, error)
- func (b *Backend) CreateSession(ctx context.Context, req *v1beta1.CreateSessionRequest) (*v1beta1.CreateSessionResponse, error)
- func (b *Backend) GetReports(ctx context.Context, req *GetReportsRequest) (*GetReportsResponse, error)
- func (b *Backend) HandleMetric(ctx context.Context, req *metric.HandleMetricRequest) (*istio_mixer_adapter_model_v1beta11.ReportResult, error)
- func (b *Backend) Reset(ctx context.Context, req *ResetRequest) (*ResetResponse, error)
- func (b *Backend) Set(ctx context.Context, req *SetRequest) (*SetResponse, error)
- func (b *Backend) Start() error
- func (b *Backend) Validate(ctx context.Context, req *v1beta1.ValidateRequest) (*v1beta1.ValidateResponse, error)
- type Controller
- type ControllerServiceClient
- type ControllerServiceServer
- type GetReportsRequest
- type GetReportsResponse
- type ResetRequest
- type ResetResponse
- type SetRequest
- type SetResponse
Constants ¶
const (
// DefaultPort for the backend service.
DefaultPort = 1071
)
Variables ¶
This section is empty.
Functions ¶
func RegisterControllerServiceServer ¶
func RegisterControllerServiceServer(s *grpc.Server, srv ControllerServiceServer)
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is the implementation of a Fake policy backend. It can be ran either in a cluster or locally.
func NewPolicyBackend ¶
NewPolicyBackend returns a new instance of Backend.
func (*Backend) CloseSession ¶
func (b *Backend) CloseSession(ctx context.Context, req *v1beta1.CloseSessionRequest) ( *v1beta1.CloseSessionResponse, error)
CloseSession is an implementation InfrastructureBackendServer.CloseSession.
func (*Backend) CreateSession ¶
func (b *Backend) CreateSession(ctx context.Context, req *v1beta1.CreateSessionRequest) ( *v1beta1.CreateSessionResponse, error)
CreateSession is an implementation InfrastructureBackendServer.CreateSession.
func (*Backend) GetReports ¶
func (b *Backend) GetReports(ctx context.Context, req *GetReportsRequest) (*GetReportsResponse, error)
GetReports method of the control service.
func (*Backend) HandleMetric ¶
func (b *Backend) HandleMetric(ctx context.Context, req *metric.HandleMetricRequest) ( *istio_mixer_adapter_model_v1beta11.ReportResult, error)
HandleMetric is an implementation HandleMetricServiceServer.HandleMetric.
func (*Backend) Reset ¶
func (b *Backend) Reset(ctx context.Context, req *ResetRequest) (*ResetResponse, error)
Reset the internal state of the service.
func (*Backend) Set ¶
func (b *Backend) Set(ctx context.Context, req *SetRequest) (*SetResponse, error)
Set method of the control service.
func (*Backend) Validate ¶
func (b *Backend) Validate(ctx context.Context, req *v1beta1.ValidateRequest) ( *v1beta1.ValidateResponse, error)
Validate is an implementation InfrastructureBackendServer.Validate.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the control interface for the policy backend. The tests can use the interface to control the fake.
func NewController ¶
func NewController(address string) (*Controller, error)
NewController creates and returns a new instance of a controller client for the backend.
func (*Controller) DenyCheck ¶
func (c *Controller) DenyCheck(deny bool) error
DenyCheck causes the policy backend to deny all check requests when set to true.
func (*Controller) GetReports ¶
func (c *Controller) GetReports() ([]proto.Message, error)
GetReports returns the currently accumulated report instances.
type ControllerServiceClient ¶
type ControllerServiceClient interface { // Set changes settings of the fake policy backend. Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error) // Resets the internal state of the policy backend (i.e. all settings are reverted to the default values // and all accumulated state is cleared. Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error) // GetReports returns the accumulated set of reports from the service. The server clears out its // accumulated cache once the call completes. GetReports(ctx context.Context, in *GetReportsRequest, opts ...grpc.CallOption) (*GetReportsResponse, error) }
func NewControllerServiceClient ¶
func NewControllerServiceClient(cc *grpc.ClientConn) ControllerServiceClient
type ControllerServiceServer ¶
type ControllerServiceServer interface { // Set changes settings of the fake policy backend. Set(context.Context, *SetRequest) (*SetResponse, error) // Resets the internal state of the policy backend (i.e. all settings are reverted to the default values // and all accumulated state is cleared. Reset(context.Context, *ResetRequest) (*ResetResponse, error) // GetReports returns the accumulated set of reports from the service. The server clears out its // accumulated cache once the call completes. GetReports(context.Context, *GetReportsRequest) (*GetReportsResponse, error) }
type GetReportsRequest ¶
type GetReportsRequest struct { }
func (*GetReportsRequest) Descriptor ¶
func (*GetReportsRequest) Descriptor() ([]byte, []int)
func (*GetReportsRequest) ProtoMessage ¶
func (*GetReportsRequest) ProtoMessage()
func (*GetReportsRequest) Reset ¶
func (m *GetReportsRequest) Reset()
func (*GetReportsRequest) String ¶
func (m *GetReportsRequest) String() string
type GetReportsResponse ¶
type GetReportsResponse struct {
Instances []*google_protobuf.Any `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"`
}
func (*GetReportsResponse) Descriptor ¶
func (*GetReportsResponse) Descriptor() ([]byte, []int)
func (*GetReportsResponse) GetInstances ¶
func (m *GetReportsResponse) GetInstances() []*google_protobuf.Any
func (*GetReportsResponse) ProtoMessage ¶
func (*GetReportsResponse) ProtoMessage()
func (*GetReportsResponse) Reset ¶
func (m *GetReportsResponse) Reset()
func (*GetReportsResponse) String ¶
func (m *GetReportsResponse) String() string
type ResetRequest ¶
type ResetRequest struct { }
func (*ResetRequest) Descriptor ¶
func (*ResetRequest) Descriptor() ([]byte, []int)
func (*ResetRequest) ProtoMessage ¶
func (*ResetRequest) ProtoMessage()
func (*ResetRequest) Reset ¶
func (m *ResetRequest) Reset()
func (*ResetRequest) String ¶
func (m *ResetRequest) String() string
type ResetResponse ¶
type ResetResponse struct { }
func (*ResetResponse) Descriptor ¶
func (*ResetResponse) Descriptor() ([]byte, []int)
func (*ResetResponse) ProtoMessage ¶
func (*ResetResponse) ProtoMessage()
func (*ResetResponse) Reset ¶
func (m *ResetResponse) Reset()
func (*ResetResponse) String ¶
func (m *ResetResponse) String() string
type SetRequest ¶
type SetRequest struct { // The settings to set on the service. Settings map[string]string `` /* 150-byte string literal not displayed */ }
func (*SetRequest) Descriptor ¶
func (*SetRequest) Descriptor() ([]byte, []int)
func (*SetRequest) GetSettings ¶
func (m *SetRequest) GetSettings() map[string]string
func (*SetRequest) ProtoMessage ¶
func (*SetRequest) ProtoMessage()
func (*SetRequest) Reset ¶
func (m *SetRequest) Reset()
func (*SetRequest) String ¶
func (m *SetRequest) String() string
type SetResponse ¶
type SetResponse struct { }
func (*SetResponse) Descriptor ¶
func (*SetResponse) Descriptor() ([]byte, []int)
func (*SetResponse) ProtoMessage ¶
func (*SetResponse) ProtoMessage()
func (*SetResponse) Reset ¶
func (m *SetResponse) Reset()
func (*SetResponse) String ¶
func (m *SetResponse) String() string