events

package
v0.0.0-...-4450389 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownUnixDomainEvent = errors.New("unknown UnixDomainEvent type")

Functions

func NewEvents

func NewEvents(
	parent ulid.I, pbs ...pb.UnixDomainEvent,
) ([]events.Event, error)

func NewPbDomainCreated

func NewPbDomainCreated(ev *EvDomainCreated) pb.UnixDomainEvent

func NewPbGroupCreated

func NewPbGroupCreated(group string, gid uint32) pb.UnixDomainEvent

func NewPbGroupDeleted

func NewPbGroupDeleted(gid uint32) pb.UnixDomainEvent

func NewPbGroupUserAdded

func NewPbGroupUserAdded(ev *EvGroupUserAdded) pb.UnixDomainEvent

func NewPbGroupUserRemoved

func NewPbGroupUserRemoved(ev *EvGroupUserRemoved) pb.UnixDomainEvent

func NewPbUserCreated

func NewPbUserCreated(ev *EvUserCreated) pb.UnixDomainEvent

func NewPbUserDeleted

func NewPbUserDeleted(uid uint32) pb.UnixDomainEvent

Types

type EvDomainCreated

type EvDomainCreated struct {
	Name string
}

`UnixDomainEvent_EV_UNIX_DOMAIN_CREATED` aka `EvDomainCreated`.

func (*EvDomainCreated) UnixDomainEvent

func (*EvDomainCreated) UnixDomainEvent()

type EvGroupCreated

type EvGroupCreated struct {
	Group string
	Gid   uint32
}

`UnixDomainEvent_EV_UNIX_GROUP_CREATED` aka `EvGroupCreated`.

func (*EvGroupCreated) UnixDomainEvent

func (*EvGroupCreated) UnixDomainEvent()

type EvGroupDeleted

type EvGroupDeleted struct {
	Gid uint32
}

`UnixDomainEvent_EV_UNIX_GROUP_DELETED` aka `EvGroupDeleted`.

func (*EvGroupDeleted) UnixDomainEvent

func (*EvGroupDeleted) UnixDomainEvent()

type EvGroupUserAdded

type EvGroupUserAdded struct {
	Gid uint32
	Uid uint32
}

`UnixDomainEvent_EV_UNIX_GROUP_USER_ADDED` aka `EvGroupUserAdded`.

func (*EvGroupUserAdded) UnixDomainEvent

func (*EvGroupUserAdded) UnixDomainEvent()

type EvGroupUserRemoved

type EvGroupUserRemoved struct {
	Gid uint32
	Uid uint32
}

`UnixDomainEvent_EV_UNIX_GROUP_USER_REMOVED` aka `EvGroupUserRemoved`.

func (*EvGroupUserRemoved) UnixDomainEvent

func (*EvGroupUserRemoved) UnixDomainEvent()

type EvUserCreated

type EvUserCreated struct {
	User string
	Uid  uint32
	Gid  uint32
}

`UnixDomainEvent_EV_UNIX_USER_CREATED` aka `EvUserCreated`.

func (*EvUserCreated) UnixDomainEvent

func (*EvUserCreated) UnixDomainEvent()

type EvUserDeleted

type EvUserDeleted struct {
	Uid uint32
}

`UnixDomainEvent_EV_UNIX_USER_DELETED` aka `EvUserDeleted`.

func (*EvUserDeleted) UnixDomainEvent

func (*EvUserDeleted) UnixDomainEvent()

type Event

type Event struct {
	// contains filtered or unexported fields
}

func (*Event) Id

func (e *Event) Id() ulid.I

func (*Event) MarshalProto

func (e *Event) MarshalProto() ([]byte, error)

func (*Event) Parent

func (e *Event) Parent() ulid.I

func (*Event) PbUnixDomainEvent

func (e *Event) PbUnixDomainEvent() *pb.UnixDomainEvent

func (*Event) UnmarshalProto

func (e *Event) UnmarshalProto(data []byte) error

func (Event) WithId

func (e Event) WithId(id ulid.I) events.Event

Receiver by value.

func (Event) WithParent

func (e Event) WithParent(parent ulid.I) events.Event

Receiver by value.

type UnixDomainEvent

type UnixDomainEvent interface {
	UnixDomainEvent()
}

func MustParsePbUnixDomainEvent

func MustParsePbUnixDomainEvent(evpb *pb.UnixDomainEvent) UnixDomainEvent

func ParsePbUnixDomainEvent

func ParsePbUnixDomainEvent(
	evpb *pb.UnixDomainEvent,
) (ev UnixDomainEvent, err error)

`ParsePbUnixDomainEvent()` converts a protobuf struct to an `Ev*` struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL