Documentation
¶
Index ¶
- Constants
- Variables
- func UnmarshalAny(any *Any) (interface{}, error)
- type Any
- func (*Any) Descriptor() ([]byte, []int)
- func (this *Any) Equal(that interface{}) bool
- func (m *Any) GetTypeUrl() string
- func (m *Any) GetValue() []byte
- func (m *Any) Marshal() (dAtA []byte, err error)
- func (a *Any) MarshalJSON() ([]byte, error)
- func (m *Any) MarshalTo(dAtA []byte) (int, error)
- func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Any) ProtoMessage()
- func (m *Any) Reset()
- func (a *Any) Scan(src interface{}) error
- func (m *Any) Size() (n int)
- func (m *Any) String() string
- func (m *Any) Unmarshal(dAtA []byte) error
- func (m *Any) XXX_DiscardUnknown()
- func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Any) XXX_Merge(src proto.Message)
- func (m *Any) XXX_Size() int
- func (m *Any) XXX_Unmarshal(b []byte) error
- type BitFlags
- type Error
- func (o Error) Code() string
- func (*Error) Descriptor() ([]byte, []int)
- func (this *Error) Equal(that interface{}) bool
- func (o Error) Error() string
- func (m *Error) GetErrorCode() string
- func (m *Error) GetErrorMessage() string
- func (m *Error) Marshal() (dAtA []byte, err error)
- func (m *Error) MarshalTo(dAtA []byte) (int, error)
- func (m *Error) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (o Error) Message() string
- func (o Error) OrigErr() error
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) Size() (n int)
- func (m *Error) String() string
- func (m *Error) Unmarshal(dAtA []byte) error
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type OpseeError
- type Permission
- func (p *Permission) CheckPermissions(pnames ...string) map[string]error
- func (p *Permission) Clear(i int)
- func (p *Permission) ClearPermission(perm string) bool
- func (p *Permission) ClearPermissions(perms ...string) (failed []string)
- func (*Permission) Descriptor() ([]byte, []int)
- func (this *Permission) Equal(that interface{}) bool
- func (m *Permission) GetName() string
- func (m *Permission) GetPerm() uint64
- func (p *Permission) HasPermissions(pnames ...string) map[string]bool
- func (p *Permission) HighBits() []int
- func (m *Permission) Marshal() (dAtA []byte, err error)
- func (p *Permission) MarshalJSON() ([]byte, error)
- func (m *Permission) MarshalTo(dAtA []byte) (int, error)
- func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Permission) Permissions() []string
- func (*Permission) ProtoMessage()
- func (m *Permission) Reset()
- func (p *Permission) Scan(src interface{}) error
- func (p *Permission) Set(i int)
- func (p *Permission) SetPermission(perm string) bool
- func (p *Permission) SetPermissions(perms ...string) (failed []string)
- func (m *Permission) Size() (n int)
- func (m *Permission) String() string
- func (p *Permission) Test(i int) bool
- func (m *Permission) Unmarshal(dAtA []byte) error
- func (p *Permission) Validate() error
- func (p *Permission) Value() (driver.Value, error)
- func (m *Permission) XXX_DiscardUnknown()
- func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Permission) XXX_Merge(src proto.Message)
- func (m *Permission) XXX_Size() int
- func (m *Permission) XXX_Unmarshal(b []byte) error
- type PermissionsBitmap
- type PermsRegistry
- type Timestamp
- func (*Timestamp) Descriptor() ([]byte, []int)
- func (this *Timestamp) Equal(that interface{}) bool
- func (m *Timestamp) GetNanos() int32
- func (m *Timestamp) GetSeconds() int64
- func (m *Timestamp) Marshal() (dAtA []byte, err error)
- func (t *Timestamp) MarshalJSON() ([]byte, error)
- func (m *Timestamp) MarshalTo(dAtA []byte) (int, error)
- func (m *Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (t *Timestamp) Millis() int64
- func (*Timestamp) ProtoMessage()
- func (m *Timestamp) Reset()
- func (t *Timestamp) Scan(src interface{}) error
- func (t *Timestamp) ScanMillis(millis int64)
- func (m *Timestamp) Size() (n int)
- func (m *Timestamp) String() string
- func (t *Timestamp) Time() time.Time
- func (m *Timestamp) Unmarshal(dAtA []byte) error
- func (t *Timestamp) UnmarshalJSON(b []byte) error
- func (t *Timestamp) Validate() error
- func (t *Timestamp) Value() (driver.Value, error)
- func (m *Timestamp) XXX_DiscardUnknown()
- func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Timestamp) XXX_Merge(src proto.Message)
- func (m *Timestamp) XXX_Size() int
- func (m *Timestamp) XXX_Unmarshal(b []byte) error
- type TypesRegistry
Constants ¶
const OpseeAdmin = "opsee_admin"
the permission which corresponds to opsee administrator
Variables ¶
var ( ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAny = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthErrors = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowErrors = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthPermissions = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPermissions = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow") )
var AnyTypeRegistry = NewTypesRegistry()
var PermissionsRegistry = NewPermsRegistry()
Functions ¶
func UnmarshalAny ¶
UnmarshalAny unmarshals an Any object based on its TypeUrl type hint.
Types ¶
type Any ¶
type Any struct { TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MarshalAny ¶
func NewPopulatedAny ¶
func (*Any) Descriptor ¶
func (*Any) GetTypeUrl ¶
func (*Any) ProtoMessage ¶
func (*Any) ProtoMessage()
func (*Any) XXX_DiscardUnknown ¶
func (m *Any) XXX_DiscardUnknown()
func (*Any) XXX_Unmarshal ¶
type BitFlags ¶
type BitFlags interface { // represents bitflats as UInt64 UInt64() // returns list of flags that are set HighFlags() []string // returns list of flags that are unset LowFlags() []string // sets a flag if it exists, returns err otherwise SetFlag(string) error // clears a flag or returns error ClearFlag(string) error // sets flags or returns errors SetFlags(...string) []error // clears flags or returns error ClearFlags(...string) []error // tests if flag is set TestFlag(string) bool // tests flags and returns bool if all flags are set TestFlags(...string) bool // initializes a flags object from a uint64 FromUInt64(uint64) error }
type Error ¶
type Error struct { ErrorCode string `protobuf:"bytes,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` ErrorMessage string `protobuf:"bytes,2,opt,name=errorMessage,proto3" json:"errorMessage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPermissionsError ¶
func NewPopulatedError ¶
func (*Error) Descriptor ¶
func (*Error) GetErrorCode ¶
func (*Error) GetErrorMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type OpseeError ¶
type OpseeError interface { error // Returns the short phrase depicting the classification of the error. Code() string // Returns the error details message. Message() string // Returns the original error if one was set. Nil is returned if not set. OrigErr() error }
Equivalent to aws-sdk-go Error interface
type Permission ¶
type Permission struct { Perm uint64 `protobuf:"fixed64,1,opt,name=perm,proto3" json:"perm,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPermissions ¶
func NewPermissions(name string, perms ...string) (*Permission, error)
Returns new permissions with mapping of bit to perms in order
func NewPopulatedPermission ¶
func NewPopulatedPermission(r randyPermissions, easy bool) *Permission
func (*Permission) CheckPermissions ¶
func (p *Permission) CheckPermissions(pnames ...string) map[string]error
Checks permissions map for permission names, returns errors for those that do not exist
func (*Permission) ClearPermission ¶
func (p *Permission) ClearPermission(perm string) bool
Clear permission by name
func (*Permission) ClearPermissions ¶
func (p *Permission) ClearPermissions(perms ...string) (failed []string)
Clear permissions by name
func (*Permission) Descriptor ¶
func (*Permission) Descriptor() ([]byte, []int)
func (*Permission) Equal ¶
func (this *Permission) Equal(that interface{}) bool
func (*Permission) GetName ¶
func (m *Permission) GetName() string
func (*Permission) GetPerm ¶
func (m *Permission) GetPerm() uint64
func (*Permission) HasPermissions ¶
func (p *Permission) HasPermissions(pnames ...string) map[string]bool
Checks permissions map for permission names, returns errors for those that do not exist
func (*Permission) Marshal ¶
func (m *Permission) Marshal() (dAtA []byte, err error)
func (*Permission) MarshalJSON ¶
func (p *Permission) MarshalJSON() ([]byte, error)
Override MarshalJson to return a list of permissions
func (*Permission) MarshalToSizedBuffer ¶
func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Permission) Permissions ¶
func (p *Permission) Permissions() []string
Returns a list of permissions we have
func (*Permission) ProtoMessage ¶
func (*Permission) ProtoMessage()
func (*Permission) Reset ¶
func (m *Permission) Reset()
func (*Permission) Scan ¶
func (p *Permission) Scan(src interface{}) error
func (*Permission) SetPermission ¶
func (p *Permission) SetPermission(perm string) bool
Set permission by name
func (*Permission) SetPermissions ¶
func (p *Permission) SetPermissions(perms ...string) (failed []string)
Set permissions by name
func (*Permission) Size ¶
func (m *Permission) Size() (n int)
func (*Permission) String ¶
func (m *Permission) String() string
func (*Permission) Unmarshal ¶
func (m *Permission) Unmarshal(dAtA []byte) error
func (*Permission) Validate ¶
func (p *Permission) Validate() error
func (*Permission) XXX_DiscardUnknown ¶
func (m *Permission) XXX_DiscardUnknown()
func (*Permission) XXX_Marshal ¶
func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Permission) XXX_Merge ¶
func (m *Permission) XXX_Merge(src proto.Message)
func (*Permission) XXX_Size ¶
func (m *Permission) XXX_Size() int
func (*Permission) XXX_Unmarshal ¶
func (m *Permission) XXX_Unmarshal(b []byte) error
type PermissionsBitmap ¶
type PermissionsBitmap struct { Name string sync.RWMutex // contains filtered or unexported fields }
func NewPermissionsBitmap ¶
func NewPermissionsBitmap(perms ...string) *PermissionsBitmap
Returns new permissions bitmap with mapping of bit to perms in order
func (*PermissionsBitmap) Bit ¶
func (p *PermissionsBitmap) Bit(perm string) (int, bool)
Returns bit number of a permission
func (*PermissionsBitmap) Get ¶
func (p *PermissionsBitmap) Get(i int) (string, bool)
Returns flag given bitnumber
func (*PermissionsBitmap) Length ¶
func (p *PermissionsBitmap) Length() int
Returns number of permissions in the Bitmap
func (*PermissionsBitmap) Register ¶
func (p *PermissionsBitmap) Register(i int, name string)
Registers permission in the Bitmap and the Inverted map
type PermsRegistry ¶
func (*PermsRegistry) Get ¶
func (p *PermsRegistry) Get(name string) (*PermissionsBitmap, bool)
func (*PermsRegistry) Register ¶
func (p *PermsRegistry) Register(name string, bmap *PermissionsBitmap)
type Timestamp ¶
type Timestamp struct { Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewPopulatedTimestamp ¶
func NewTimestamp ¶
func NewTimestamp(src interface{}) *Timestamp
Returns a new timestamp by scanning value in src. On scan error, returns the zero value.
func (*Timestamp) Descriptor ¶
func (*Timestamp) GetSeconds ¶
func (*Timestamp) MarshalJSON ¶
func (*Timestamp) MarshalToSizedBuffer ¶
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()
func (*Timestamp) ScanMillis ¶
func (*Timestamp) UnmarshalJSON ¶
func (*Timestamp) XXX_DiscardUnknown ¶
func (m *Timestamp) XXX_DiscardUnknown()