github.com/gravitational/teleport/api@v0.0.0-20240507183017-3110591cbafc/types/events/metadata.go (about)

     1  /*
     2  Copyright 2021 Gravitational, Inc.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package events
    18  
    19  import "time"
    20  
    21  // GetType returns event type
    22  func (m *Metadata) GetType() string {
    23  	return m.Type
    24  }
    25  
    26  // SetType sets unique type
    27  func (m *Metadata) SetType(etype string) {
    28  	m.Type = etype
    29  }
    30  
    31  // GetID returns event ID
    32  func (m *Metadata) GetID() string {
    33  	return m.ID
    34  }
    35  
    36  // GetCode returns event code
    37  func (m *Metadata) GetCode() string {
    38  	return m.Code
    39  }
    40  
    41  // SetCode sets event code
    42  func (m *Metadata) SetCode(code string) {
    43  	m.Code = code
    44  }
    45  
    46  // SetID sets event ID
    47  func (m *Metadata) SetID(id string) {
    48  	m.ID = id
    49  }
    50  
    51  // GetTime returns event time
    52  func (m *Metadata) GetTime() time.Time {
    53  	return m.Time
    54  }
    55  
    56  // SetTime sets event time
    57  func (m *Metadata) SetTime(tm time.Time) {
    58  	m.Time = tm
    59  }
    60  
    61  // SetIndex sets event index
    62  func (m *Metadata) SetIndex(idx int64) {
    63  	m.Index = idx
    64  }
    65  
    66  // GetIndex gets event index
    67  func (m *Metadata) GetIndex() int64 {
    68  	return m.Index
    69  }
    70  
    71  // GetClusterName returns originating teleport cluster name
    72  func (m *Metadata) GetClusterName() string {
    73  	return m.ClusterName
    74  }
    75  
    76  // SetClusterName returns originating teleport cluster name
    77  func (m *Metadata) SetClusterName(clusterName string) {
    78  	m.ClusterName = clusterName
    79  }
    80  
    81  // GetServerID returns event server ID
    82  func (m *ServerMetadata) GetServerID() string {
    83  	return m.ServerID
    84  }
    85  
    86  // SetServerID sets event server ID
    87  func (m *ServerMetadata) SetServerID(id string) {
    88  	m.ServerID = id
    89  }
    90  
    91  // GetServerNamespace returns event server ID
    92  func (m *ServerMetadata) GetServerNamespace() string {
    93  	return m.ServerNamespace
    94  }
    95  
    96  // SetServerNamespace sets server namespace
    97  func (m *ServerMetadata) SetServerNamespace(ns string) {
    98  	m.ServerNamespace = ns
    99  }
   100  
   101  // GetSessionID returns event session ID
   102  func (m *SessionMetadata) GetSessionID() string {
   103  	return m.SessionID
   104  }
   105  
   106  // GetUser returns event teleport user
   107  func (m *UserMetadata) GetUser() string {
   108  	return m.User
   109  }